Spaces:
Paused
Paused
Download Dockerfile from playingapi/abacus2api: direct link, hf CLI and curl.
- Browser
- Download file 471 Bytes
-
https://huggingface.co/spaces/playingapi/abacus2api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/playingapi/abacus2api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/playingapi/abacus2api/resolve/main/Dockerfile
471 Bytes
| # 使用官方Python基础镜像 | |
| FROM python:3.9-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 先复制依赖列表文件(利用Docker的层缓存机制) | |
| COPY requirements.txt . | |
| # 安装项目依赖 | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 复制项目所有文件到容器 | |
| COPY . . | |
| # 暴露服务运行的端口 | |
| EXPOSE 8000 | |
| # 启动命令(注意:生产环境不要使用--reload) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |