2025-11-25 08:29:43 +01:00
|
|
|
FROM python:3.12-slim
|
|
|
|
|
|
|
|
|
|
ARG PORT=8051
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2025-11-30 21:36:29 +01:00
|
|
|
# Install uv first (cached layer)
|
2025-11-25 08:29:43 +01:00
|
|
|
RUN pip install uv
|
|
|
|
|
|
2025-11-30 21:36:29 +01:00
|
|
|
# Copy only dependency files first (cached layer)
|
|
|
|
|
COPY pyproject.toml uv.lock* ./
|
|
|
|
|
|
|
|
|
|
# Install dependencies (cached unless pyproject.toml changes)
|
|
|
|
|
RUN uv pip install --system .
|
|
|
|
|
|
|
|
|
|
# Run crawl4ai-setup for Playwright (cached layer)
|
|
|
|
|
RUN crawl4ai-setup
|
|
|
|
|
|
|
|
|
|
# Copy source code last (only this invalidates on code changes)
|
2025-11-25 08:29:43 +01:00
|
|
|
COPY . .
|
|
|
|
|
|
2025-11-30 21:36:29 +01:00
|
|
|
# Re-install in editable mode (fast, deps already installed)
|
|
|
|
|
RUN uv pip install --system -e . --no-deps
|
2025-11-25 08:29:43 +01:00
|
|
|
|
|
|
|
|
EXPOSE ${PORT}
|
|
|
|
|
|
|
|
|
|
CMD ["python", "src/crawl4ai_mcp.py"]
|