FROM python:3.12-slim WORKDIR /app COPY requirements.txt . RUN apt-get update \ && apt-get install -y --no-install-recommends \ xvfb xauth \ fonts-liberation fonts-unifont \ libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 \ libcairo2 libcups2t64 libdbus-1-3 libdrm2 libexpat1 \ libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 \ libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 \ libxfixes3 libxkbcommon0 libxrandr2 libxrender1 libxtst6 \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir -r requirements.txt \ && playwright install chromium COPY app.py . ENV PYTHONUNBUFFERED=1 EXPOSE 7860 CMD xvfb-run -a -s "-screen 0 1280x1024x24" uvicorn app:app --host 0.0.0.0 --port 7860