yi124773651 commited on
Commit
fb9e2ce
·
verified ·
1 Parent(s): 3377ead

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -17
Dockerfile CHANGED
@@ -2,28 +2,21 @@ FROM eceasy/cli-proxy-api:latest
2
 
3
  USER root
4
 
5
- # 1. 安装基础兼容库
6
- RUN apk add --no-cache libc6-compat gcompat bash
7
 
8
- # 2. 设置工作目录
9
  WORKDIR /app
 
 
10
 
11
- # 3. 核心修复:从文件夹中拷贝同名的二进制文件
12
- # 之前的报错是因为 /CLIProxyAPI 是目录,所以 cp 命令报错
13
- RUN cp /CLIProxyAPI/CLIProxyAPI ./cli-proxy-api && \
14
- chmod +x ./cli-proxy-api
15
-
16
- # 4. 准备权限与目录
17
- RUN mkdir -p /tmp/.cli-proxy-api /tmp/logs && \
18
- chmod -R 777 /tmp
19
-
20
- # 5. 拷贝你手动上传的配置文件
21
  COPY config.yaml /app/config.yaml
 
22
 
23
- # 环境变量设置
24
- ENV PORT=7860
25
  ENV TZ=Asia/Shanghai
26
  EXPOSE 7860
27
 
28
- # 6. 启动命令
29
- CMD ["./cli-proxy-api", "--config", "/app/config.yaml"]
 
2
 
3
  USER root
4
 
5
+ # 1. 安装 Nginx 和 Go 兼容库
6
+ RUN apk add --no-cache nginx libc6-compat gcompat bash
7
 
8
+ # 2. 准备工作目录
9
  WORKDIR /app
10
+ RUN cp /CLIProxyAPI/CLIProxyAPI ./cli-proxy-api && chmod +x ./cli-proxy-api
11
+ RUN mkdir -p /tmp/.cli-proxy-api /tmp/logs /run/nginx && chmod -R 777 /tmp /run/nginx
12
 
13
+ # 3. 拷贝配置
 
 
 
 
 
 
 
 
 
14
  COPY config.yaml /app/config.yaml
15
+ COPY nginx.conf /etc/nginx/nginx.conf
16
 
17
+ # 4. 环境变量
 
18
  ENV TZ=Asia/Shanghai
19
  EXPOSE 7860
20
 
21
+ # 5. 启动脚本:后台运行 Nginx,前台运行 API
22
+ CMD ["sh", "-c", "nginx && ./cli-proxy-api --config /app/config.yaml"]