| # Use an appropriate base image | |
| FROM python:3.9-slim | |
| # Install system dependencies required by Playwright browsers | |
| RUN apt-get update && apt-get install -y \ | |
| libnss3 \ | |
| libnspr4 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libatspi2.0-0 \ | |
| && apt-get clean | |
| # Install your Python dependencies including Playwright | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Optionally install Playwright browsers (if not done in your code) | |
| RUN python -m playwright install | |
| # Copy your application code | |
| COPY . /app | |
| WORKDIR /app | |
| CMD ["python", "app.py"] |