FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y \ libgbm1 \ libnss3 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libcups2 \ libdrm2 \ libxkbcommon0 \ libxcomposite1 \ libxdamage1 \ libxrandr2 \ libasound2 \ libpango-1.0-0 \ libcairo2 \ wget \ gnupg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install Playwright browsers RUN playwright install chromium RUN playwright install-deps chromium # Copy the rest of the application COPY . . # Expose the port EXPOSE 7860 # Run the application CMD ["python", "app.py"]