# Base Python image FROM python:3.11-slim # Set working directory WORKDIR /app # Install system dependencies for Playwright and Chromium RUN apt-get update && apt-get install -y \ curl \ gnupg \ ca-certificates \ fonts-liberation \ libasound2 \ libatk1.0-0 \ libcups2 \ libdbus-1-3 \ libdrm2 \ libgtk-3-0 \ libnspr4 \ libnss3 \ libxcomposite1 \ libxdamage1 \ libxrandr2 \ xdg-utils \ wget \ unzip \ git \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgl1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /code # Copy your project code COPY . . # Install Python dependencies #dependencies RUN pip install --no-cache-dir -r requirements.txt # Install Playwright browsers RUN playwright install --with-deps # Expose FastAPI port EXPOSE 7860 # Start FastAPI CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]