github-actions[bot]
Automated deployment from GitHub Actions: a9d5a91de63ad7224bafe6039fb2b7479388fbf4
0a8c81b Download Dockerfile from VLTA-AI/dropshop: direct link, hf CLI and curl.
- Browser
- Download file 759 Bytes
-
https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/VLTA-AI/dropshop/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/Dockerfile
759 Bytes
| FROM python:3.11-slim-bookworm | |
| # 复制需要用到的 C 库和基础工具 | |
| RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates | |
| # 安装 uv 作为包管理器 | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 安装依赖 | |
| # 将 .venv 放在项目目录,利用 uv 同步 | |
| COPY pyproject.toml uv.lock ./ | |
| RUN uv sync --frozen --no-install-project --no-dev | |
| # 复制整个项目代码 | |
| COPY . . | |
| RUN uv sync --frozen --no-dev | |
| # 把 .venv 的可执行路径加到 PATH 里 | |
| ENV PATH="/app/.venv/bin:$PATH" | |
| # 暴露 7860 端口(这是 Hugging Face Docker Space 的强制要求) | |
| EXPOSE 7860 | |
| # 启动 FastAPI 服务 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |