Create Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM eceasy/cli-proxy-api:latest
|
| 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"]
|