Spaces:
Runtime error
Runtime error
Download Dockerfile from nbnb9/briefing-api: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/nbnb9/briefing-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/nbnb9/briefing-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/nbnb9/briefing-api/resolve/main/Dockerfile
568 Bytes
| # 1. 选择基础镜像(轻量级的Python运行环境) | |
| FROM python:3.11-slim | |
| # 2. 设置容器内的工作目录 | |
| WORKDIR /app | |
| # 3. 复制依赖文件(利用Docker缓存加速构建) | |
| COPY requirements.txt . | |
| # 4. 安装所有依赖(使用国内镜像加速) | |
| RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple | |
| # 5. 复制项目所有文件到工作目录 | |
| COPY . . | |
| # 6. 暴露容器内部服务的端口 | |
| EXPOSE 7860 | |
| # 7. 启动命令 | |
| CMD ["uvicorn", "briefing_api:app", "--host", "0.0.0.0", "--port", "7860"] |