Update Dockerfile
Browse files- 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 |
-
#
|
| 29 |
-
CMD ["./cli-proxy-api
|
|
|
|
| 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"]
|