更鲁棒的官方配置文件

#1
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -3,7 +3,7 @@ FROM eceasy/cli-proxy-api:latest
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
@@ -18,5 +18,9 @@ COPY nginx.conf /etc/nginx/nginx.conf
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"]
 
 
 
 
 
3
  USER root
4
 
5
  # 1. 安装 Nginx 和 Go 兼容库
6
+ RUN apk add --no-cache nginx libc6-compat gcompat bash curl
7
 
8
  # 2. 准备工作目录
9
  WORKDIR /app
 
18
  ENV TZ=Asia/Shanghai
19
  EXPOSE 7860
20
 
21
+ # 5. 健康检查
22
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
23
+ CMD curl -f http://127.0.0.1:7860/ || exit 1
24
+
25
+ # 6. 启动脚本:后台运行 Nginx,前台运行 API
26
+ CMD ["sh", "-c", "nginx && ./cli-proxy-api"]