- Remove sentence-transformers dependency (saves ~3GB PyTorch/CUDA) - Make CrossEncoder import optional with graceful fallback - Optimize Dockerfile for layer caching (incremental builds ~3s) - Change PostgREST port from 3000 to 3001 (avoid Next.js conflict) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
585 B
Docker
27 lines
585 B
Docker
FROM python:3.12-slim
|
|
|
|
ARG PORT=8051
|
|
WORKDIR /app
|
|
|
|
# Install uv first (cached layer)
|
|
RUN pip install uv
|
|
|
|
# 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)
|
|
COPY . .
|
|
|
|
# Re-install in editable mode (fast, deps already installed)
|
|
RUN uv pip install --system -e . --no-deps
|
|
|
|
EXPOSE ${PORT}
|
|
|
|
CMD ["python", "src/crawl4ai_mcp.py"]
|