jimlv commited on
Commit
d3a0339
·
verified ·
1 Parent(s): 79265e7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -3,21 +3,23 @@ FROM keymetrics/pm2:18-alpine
3
  # 安装 Nginx
4
  RUN apk add --no-cache nginx
5
 
6
- # 删除默认的 default.conf(避免冲突)
7
- RUN rm -f /etc/nginx/http.d/default.conf
8
 
9
- # 把你的自定义 server 配置复制到 conf.d 目录(注意不是 http.d)
10
- # 在主配置文件 /etc/nginx/nginx.conf 中已经包含了 include /etc/nginx/conf.d/*.conf;
11
- COPY nginx.conf /etc/nginx/conf.d/default.conf
12
 
13
- # 复制项目文件
14
  WORKDIR /app
 
 
15
  COPY package*.json ./
16
  COPY ecosystem.config.js ./
17
  COPY apps/ ./apps/
18
 
19
- # 复制启动脚本
20
  COPY start.sh /start.sh
21
  RUN chmod +x /start.sh
22
 
 
23
  CMD ["/start.sh"]
 
3
  # 安装 Nginx
4
  RUN apk add --no-cache nginx
5
 
6
+ # 删除所有可能冲突的默认配置
7
+ RUN rm -f /etc/nginx/http.d/default.conf /etc/nginx/conf.d/*.conf
8
 
9
+ # 复制你写好的完整 nginx.conf 到主配置位置
10
+ COPY nginx.conf /etc/nginx/nginx.conf
 
11
 
12
+ # 设置工作目录
13
  WORKDIR /app
14
+
15
+ # 复制项目文件
16
  COPY package*.json ./
17
  COPY ecosystem.config.js ./
18
  COPY apps/ ./apps/
19
 
20
+ # 启动脚本
21
  COPY start.sh /start.sh
22
  RUN chmod +x /start.sh
23
 
24
+ EXPOSE 7860
25
  CMD ["/start.sh"]