# Use the official Microsoft Playwright Python image (includes browsers) FROM mcr.microsoft.com/playwright/python:v1.49.0-jammy # Set working directory WORKDIR /code # Copy requirements and install python dependencies COPY requirements.txt . RUN pip install --no-cache-dir --upgrade -r requirements.txt # Install the browsers (Chromium specifically for speed) RUN playwright install chromium # Copy the rest of the application COPY . . # Create a writable directory for cache/permissions if needed RUN chmod -R 777 /code # Expose the port Hugging Face expects EXPOSE 7860 # Run the Flask app using Gunicorn CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120", "--workers", "1"]