Explorar el Código

Do not install on run (#30)

* Do not install on run

The docker image should contains already resolved dependencies.

No need for a start.sh, you could just run node directly.

* Simplify Dockerfile
dev_h
Cyrille Pontvieux hace 5 años
padre
commit
e090e857dd
No account linked to committer's email address
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  1. 3
    7
      Dockerfile

+ 3
- 7
Dockerfile Ver fichero

1
 FROM node:10-alpine
1
 FROM node:10-alpine
2
 
2
 
3
-WORKDIR /opt/app
4
 COPY . /opt/app
3
 COPY . /opt/app
4
+WORKDIR /opt/app
5
+RUN npm install --production
5
 
6
 
6
 ENV PORT=80
7
 ENV PORT=80
7
 EXPOSE 80
8
 EXPOSE 80
8
 
9
 
9
 VOLUME /opt/app/server-data
10
 VOLUME /opt/app/server-data
10
 
11
 
11
-RUN touch /usr/bin/start.sh # this is the script which will run on start
12
-
13
-RUN echo 'npm install --production' >> /usr/bin/start.sh
14
-RUN echo 'node /opt/app/server/server.js' >> /usr/bin/start.sh
15
-
16
-CMD ["/bin/sh","/usr/bin/start.sh"]
12
+CMD ["npm", "start"]

Loading…
Cancelar
Guardar