| # Use a Python base image with Playwright support | |
| FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy | |
| # Set work directory | |
| WORKDIR /app | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install Playwright browsers (already in the base image, but ensure chromium is there) | |
| RUN playwright install chromium | |
| # Copy the rest of the application | |
| COPY . . | |
| # Set permissions for Hugging Face (Port 7860 is mandatory) | |
| EXPOSE 7860 | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| ENV GRADIO_SERVER_PORT=7860 | |
| # Run the app | |
| CMD ["python", "app.py"] | |