40 lines
830 B
Docker
40 lines
830 B
Docker
# Use Python 3.13 slim image
|
|
FROM python:3.13-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for Playwright
|
|
RUN apt-get update && apt-get install -y \
|
|
wget \
|
|
gnupg \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install uv
|
|
RUN pip install uv
|
|
|
|
# Copy dependency files first (for better caching)
|
|
COPY pyproject.toml .
|
|
COPY uv.lock .
|
|
|
|
# Install Python dependencies
|
|
RUN uv sync --frozen
|
|
|
|
# Install Playwright browsers (heavy operation, cache this layer)
|
|
RUN uv run playwright install chromium
|
|
RUN uv run playwright install-deps chromium
|
|
|
|
# Copy application code
|
|
COPY main.py .
|
|
|
|
# Copy sample images for mock data testing
|
|
COPY images/ ./images/
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONIOENCODING=utf-8
|
|
|
|
# Run the application
|
|
CMD ["uv", "run", "python", "main.py"]
|