jianwei233 commited on
Commit
e701c5f
·
verified ·
1 Parent(s): afdb473

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -46
Dockerfile CHANGED
@@ -1,51 +1,9 @@
1
- # 使用 vinlic/doubao-free-api 作为构建阶段的基础镜像
2
- FROM vinlic/doubao-free-api:latest AS builder
3
 
4
- # 使用 Node.js 的 Alpine 版本作为中间镜像
5
- FROM node:18-alpine AS node-builder
6
-
7
- # 设置工作目录
8
  WORKDIR /app
9
 
10
- # 从构建镜像中复制应用程序
11
- COPY --from=builder /app /app
12
-
13
- # 安装依赖(如果需要)
14
- RUN npm install --prefix /app
15
-
16
- # 使用 Nginx 的 Alpine 版本作为最终镜像
17
- FROM nginx:alpine
18
-
19
- # 安装 Node.js 和 npm
20
- RUN apk add --no-cache nodejs npm
21
-
22
- RUN npm install -g pm2
23
-
24
-
25
- # 复制 Node.js 应用中的必要文件
26
- COPY --from=node-builder /app /app
27
-
28
- # 设置工作目录
29
- WORKDIR /app
30
-
31
-
32
- # 设置权限和创建必要的目录
33
- RUN chmod 777 /app && \
34
- mkdir -p /data && chmod 777 /data && \
35
- mkdir -p /data/logs && chmod 777 /data/logs && \
36
- chmod 777 /var/cache/nginx && \
37
- mkdir -p /var/log/nginx && chmod 777 /var/log/nginx && \
38
- touch /var/run/nginx.pid && chmod 777 /var/run/nginx.pid
39
-
40
- # 复制 Nginx 配置文件
41
- COPY nginx.conf /etc/nginx/nginx.conf
42
-
43
- # 暴露 Nginx 的端口
44
- EXPOSE 7860
45
 
46
- # 复制启动脚本
47
- COPY start.sh /start.sh
48
- RUN chmod +x /start.sh
49
 
50
- # 启动 Nginx 和 Node.js 应用
51
- CMD ["/start.sh"]
 
1
+ FROM openmind000/doubaofree:merge-latest
 
2
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ RUN chmod -R 777 /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ EXPOSE 8000
 
 
8
 
9
+ CMD ["npm", "start"]