Browse Source

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 5 years ago
parent
commit
e090e857dd
No account linked to committer's email address
1 changed files with 3 additions and 7 deletions
  1. 3
    7
      Dockerfile

+ 3
- 7
Dockerfile View File

@@ -1,16 +1,12 @@
1 1
 FROM node:10-alpine
2 2
 
3
-WORKDIR /opt/app
4 3
 COPY . /opt/app
4
+WORKDIR /opt/app
5
+RUN npm install --production
5 6
 
6 7
 ENV PORT=80
7 8
 EXPOSE 80
8 9
 
9 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…
Cancel
Save