Download Dockerfile from agi001/llms: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/spaces/agi001/llms/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/agi001/llms/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/agi001/llms/resolve/main/Dockerfile
708 Bytes
| # 使用官方构建的最新镜像作为基础 | |
| FROM ghcr.io/tbphp/gpt-load:latest | |
| # 1. 设置工作目录 (保持与官方一致) | |
| WORKDIR /app | |
| # 2. 关键:设置 Hugging Face 要求的端口环境变量 | |
| # gpt-load 会读取这个变量来决定监听端口 | |
| ENV PORT=7860 | |
| # 3. 暴露端口 (这是告诉 HF 网络层的) | |
| EXPOSE 7860 | |
| # 4. 权限修正 | |
| # Hugging Face Spaces 运行时通常是非 root 用户, | |
| # 我们需要确保 /app/data 目录(用于存放临时日志或文件)是可写的 | |
| USER root | |
| RUN mkdir -p /app/data && chmod 777 /app/data | |
| # 5. 启动命令 | |
| # 基础镜像已经定义了 ENTRYPOINT/CMD,这里不需要重写, | |
| # 它会自动读取上面的 ENV PORT=7860 启动服务 |