Dockerfile 705 B

1234567891011121314151617181920212223242526272829
  1. FROM python:3.12-slim
  2. WORKDIR /app
  3. RUN apt-get update && apt-get install -y --no-install-recommends \
  4. build-essential \
  5. curl \
  6. libpq-dev \
  7. && rm -rf /var/lib/apt/lists/*
  8. COPY pyproject.toml uv.lock ./
  9. # 配置 pip/uv 使用阿里云镜像,使用系统 Python
  10. ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
  11. ENV UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
  12. ENV UV_PYTHON_PREFERENCE=system
  13. RUN pip install --no-cache-dir uv && \
  14. uv sync --frozen --no-dev
  15. COPY . .
  16. # 安装 Playwright Chromium 浏览器(Crawl4AI 依赖)
  17. RUN .venv/bin/python -m playwright install --with-deps chromium
  18. RUN chmod +x entrypoint.sh
  19. ENTRYPOINT ["./entrypoint.sh"]
  20. EXPOSE 5000