Spaces:
Paused
Paused
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # 安装 Playwright 所需系统依赖 + git(用于 clone) | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| ca-certificates \ | |
| libnss3 \ | |
| libnspr4 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libxkbcommon0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libasound2 \ | |
| libpango-1.0-0 \ | |
| libcairo2 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| ARG REPO_URL=https://github.com/TheSmallHanCat/flow2api.git | |
| ARG REPO_REF=main | |
| # clone 代码到 /app | |
| RUN git clone --depth 1 --branch "${REPO_REF}" "${REPO_URL}" . | |
| # 安装 Python 依赖(来自仓库内 requirements.txt) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 安装 Playwright 浏览器 | |
| RUN python -m playwright install chromium | |
| EXPOSE 8000 | |
| CMD ["python", "main.py"] |