Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubles building the Docker image #355

Open
Lenormju opened this issue Nov 30, 2023 · 0 comments
Open

Troubles building the Docker image #355

Lenormju opened this issue Nov 30, 2023 · 0 comments

Comments

@Lenormju
Copy link

Hello,

I had to build the Dockerfile (see #330) and hit several problems :

  • I had to build on a network that reaches internet through a corporate proxy
  • I got Bower errors (unsure why, and I'm not an expert in it)
  • It was not using an Alpine image (personal preference)

Here are the modifications I made :

Dockerfile

-FROM node:19
+FROM node:19-alpine
 
 # Create app directory
 WORKDIR /usr/src/electron-release-server
 
+RUN mkdir -p /usr/local/share/ca-certificates/
 # Create app directory
 WORKDIR /usr/src/electron-release-server
 
+RUN mkdir -p /usr/local/share/ca-certificates/
+RUN wget -Y off -O /root/my-root-ca.crt URL_TO_THE_FILE_CA.crt
+RUN cat /root/my-root-ca.crt >> /etc/ssl/certs/ca-certificates.crt
+RUN cat /root/my-root-ca.crt >> /usr/local/share/ca-certificates/ca-certificates.crt
+RUN apk --update add ca-certificates
+RUN update-ca-certificates
+
+RUN apk --update add git
+
 # Install app dependencies
-COPY package.json .bowerrc bower.json /usr/src/electron-release-server/
+COPY package.json package-lock.json .bowerrc bower.json /usr/src/electron-release-server/
 RUN npm install \

(replace URL_TO_THE_FILE_CA by yours)

.bowerrc

 {
-  "directory": "assets/bower_components"
+  "directory": "assets/bower_components",
+  "proxy": "http://PROXY_URL:80",
+  "https-proxy": "http://PROXY_URL:80",
+  "ca": "/usr/local/share/ca-certificates/ca-certificates.crt"
 }

(replace PROXY_URL by yours)

package.json

     "inspect": "node --inspect app.js",
     "start": "node app.js",
     "migrate": "db-migrate",
-    "postinstall": "bower install",
     "eslint": "eslint ./*.js api assets/js config migrations tasks",
     "stylelint": "stylelint assets/styles/*.*"
   },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant