FROM python:3.14-slim-bookworm COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ # Install system dependencies for lxml, aiohttp, and Playwright RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ libxml2-dev \ libxslt-dev \ # Playwright dependencies libglib2.0-0 \ libnss3 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libcups2 \ libdrm2 \ libxkbcommon0 \ libxcomposite1 \ libxdamage1 \ libxext6 \ libxfixes3 \ librandr2 \ libgbm1 \ libpango-1.0-0 \ libcairo2 \ libasound2 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install dependencies RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --frozen --no-install-project # Install Playwright browser (Chromium) RUN uv run playwright install chromium --with-deps # Copy the rest of the application COPY . . # Run the bot CMD ["uv", "run", "python", "bot.py"]