# Dockerfile — last updated: Dec 2025 FROM python:3.11-slim # Install system deps required by Playwright/Chromium RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates fonts-liberation libnss3 libatk1.0-0 libatk-bridge2.0-0 \ libcups2 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libasound2 \ libpangocairo-1.0-0 libxss1 wget gnupg dirmngr \ && rm -rf /var/lib/apt/lists/* # ensure pip is latest and install packages to user site RUN python -m pip install --upgrade pip RUN useradd -m -u 1000 appuser USER appuser ENV PATH="/home/appuser/.local/bin:$PATH" WORKDIR /app # copy requirements and install (user site) COPY --chown=appuser:appuser requirements.txt . RUN pip install --no-cache-dir --user -r requirements.txt # Install Playwright browsers (with deps) RUN python -m playwright install chromium # Copy app source COPY --chown=appuser:appuser . . # Expose port used by Gradio ENV GRADIO_SERVER_PORT=7860 CMD ["python", "app.py"]