FROM python:3.10-slim # Force python logs to flush instantly to prevent the "No logs" display ENV PYTHONUNBUFFERED=1 ENV DEBIAN_FRONTEND=noninteractive # Install essential system tools for Xvfb display management RUN apt-get update && apt-get install -y \ xvfb \ wget \ gnupg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # CRITICAL FIX: Tell playwright to install chromium AND all required system level libraries RUN playwright install chromium RUN playwright install-deps chromium COPY . . # Ensure the container knows it needs to execute through the virtual frame buffer CMD ["xvfb-run", "--server-args=-screen 0 1366x768x24", "python", "app.py"]