# Official Playwright Python image (includes Firefox + all deps) # Use a specific version tag for reproducibility (latest as of Dec 2025 is v1.48+, but check for newer) FROM mcr.microsoft.com/playwright/python:v1.48.0-noble # Optional: install any extra system packages you might need RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy and install Python dependencies (playwright is already in the image, so don't include it in requirements.txt) COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt # Copy your app COPY app.py /app/ # Environment variables ENV PORT=7860 ENV USE_PLAYWRIGHT=1 EXPOSE 7860 CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"]