FROM python:3.10-slim # Required to avoid some interactive prompts or issues ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ curl \ wget \ gnupg \ unzip \ fonts-liberation \ libnss3 \ libxss1 \ libasound2 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libgtk-3-0 \ libdrm2 \ libgbm1 \ libxcomposite1 \ libxrandr2 \ libxdamage1 \ libxfixes3 \ libx11-xcb1 \ libxrender1 \ libxtst6 \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # Copy and install Python requirements COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Install Playwright with browser binaries RUN playwright install chromium COPY . . CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]