浏览代码

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 年前
父节点
当前提交
e090e857dd
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3
    7
      Dockerfile

+ 3
- 7
Dockerfile 查看文件

@@ -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"]

正在加载...
取消
保存