# =============================== # 🐳 Dockerfile for Hugging Face Spaces - FastAPI + Playwright # =============================== FROM python:3.10-slim WORKDIR /app # Install system dependencies for Playwright + fonts RUN apt-get update && apt-get install -y \ wget gnupg ca-certificates curl unzip \ libxkbcommon0 libnss3 libatk1.0-0 libatk-bridge2.0-0 \ libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 \ libasound2 libxshmfence1 libxext6 libxfixes3 libdrm2 \ fonts-liberation libappindicator3-1 libnspr4 libx11-xcb1 libxrender1 \ && rm -rf /var/lib/apt/lists/* # Copy dependencies and install them COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # ✅ Install Playwright Chromium RUN pip install --no-cache-dir playwright RUN playwright install --with-deps chromium # Copy the rest of your app COPY . . # Hugging Face Spaces expects apps on port 7860 EXPOSE 7860 # Run FastAPI app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]