# ---- base image ---- FROM python:3.11-slim # 1) system deps needed by Playwright/Chromium RUN apt-get update && apt-get install -y --no-install-recommends \ wget gnupg ca-certificates libnss3 libatk-bridge2.0-0 libgtk-3-0 \ libdrm2 libgbm1 libxtst6 libxdamage1 libxfixes3 libxcomposite1 \ libxrandr2 libasound2 libcurl4 xvfb && \ rm -rf /var/lib/apt/lists/* # 2) python deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 3) install Chromium for Playwright RUN playwright install chromium # 4) fastapi entry-point COPY app.py . EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]