Download Dockerfile from lydgs/cliproxy: direct link, hf CLI and curl.
- Browser
- Download file 954 Bytes
-
https://huggingface.co/spaces/lydgs/cliproxy/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/lydgs/cliproxy/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/lydgs/cliproxy/resolve/main/Dockerfile
954 Bytes
| FROM eceasy/cli-proxy-api:latest | |
| USER root | |
| # 1. 安装 Nginx 和 Go 兼容库 | |
| RUN apt-get update && apt-get install -y \ | |
| nginx \ | |
| libc6-compat \ # 注意:Debian 不需要这个包,通常用 libc6 即可,建议去掉 | |
| gcompat \ # 这是 Alpine 特有的,Debian 不需要,可删除 | |
| bash \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. 准备工作目录 | |
| WORKDIR /app | |
| RUN cp /CLIProxyAPI/CLIProxyAPI ./cli-proxy-api && chmod +x ./cli-proxy-api | |
| RUN mkdir -p /tmp/.cli-proxy-api /tmp/logs /run/nginx && chmod -R 777 /tmp /run/nginx | |
| # 3. 拷贝配置 | |
| COPY config.yaml /app/config.yaml | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| # 4. 环境变量 | |
| ENV TZ=Asia/Shanghai | |
| EXPOSE 7860 | |
| # 5. 健康检查 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ | |
| CMD curl -f http://127.0.0.1:7860/ || exit 1 | |
| # 6. 启动脚本:后台运行 Nginx,前台运行 API | |
| CMD ["sh", "-c", "nginx && ./cli-proxy-api"] |