jimlv commited on
Commit
9ebca10
·
verified ·
1 Parent(s): b71ef4c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -5
Dockerfile CHANGED
@@ -1,13 +1,22 @@
1
  FROM keymetrics/pm2:18-alpine
2
 
3
- # 1. 安装 Nginx
4
  RUN apk add --no-cache nginx
5
 
6
- # 2. 删除默认配置,复制你写好的 nginx.conf
7
- RUN rm /etc/nginx/http.d/default.conf
8
- COPY nginx.conf /etc/nginx/nginx.conf
9
 
10
- # 3. 启动 Nginx 和 PM2
 
 
 
 
 
 
 
 
 
 
11
  COPY start.sh /start.sh
12
  RUN chmod +x /start.sh
13
 
 
1
  FROM keymetrics/pm2:18-alpine
2
 
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