浏览代码

enhance the Dockerfile with default CMD to start

dev_h
Argan Wang 6 年前
父节点
当前提交
b6a8b754a8
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      Dockerfile

+ 4
- 1
Dockerfile 查看文件

1
 FROM node:10-alpine
1
 FROM node:10-alpine
2
 
2
 
3
 WORKDIR /opt/app
3
 WORKDIR /opt/app
4
-
4
+COPY . /opt/app
5
 ENV PORT=80
5
 ENV PORT=80
6
+VOLUME /opt/app/server-data
6
 
7
 
7
 RUN touch /usr/bin/start.sh # this is the script which will run on start
8
 RUN touch /usr/bin/start.sh # this is the script which will run on start
8
 
9
 
24
 
25
 
25
 # npm start, make sure to have a start attribute in "scripts" in package.json
26
 # npm start, make sure to have a start attribute in "scripts" in package.json
26
 RUN echo 'npm start' >> /usr/bin/start.sh
27
 RUN echo 'npm start' >> /usr/bin/start.sh
28
+
29
+CMD ["/bin/sh","/usr/bin/start.sh"]

正在加载...
取消
保存