FROM python:3.11-slim # ── System deps for Playwright/Chromium ─────────────────────────────────── RUN apt-get update && apt-get install -y --no-install-recommends \ wget curl gnupg ca-certificates \ libnss3 libatk-bridge2.0-0 libcups2 libxkbcommon0 \ libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 \ libasound2 libpangocairo-1.0-0 libpango-1.0-0 \ libcairo2 libatk1.0-0 libgdk-pixbuf2.0-0 \ libx11-6 libx11-xcb1 libxcb1 libxext6 libxss1 \ fonts-liberation \ build-essential libpq-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # ── Python deps ───────────────────────────────────────────────────────────── COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # ── Install Chromium for rebrowser-playwright (stealth scraper) ───────────── RUN rebrowser_playwright install chromium --with-deps # ── App code ──────────────────────────────────────────────────────────────── COPY . . # ── HuggingFace Spaces expects port 7860 ─────────────────────────────────── EXPOSE 7860 # ── Run: migrate then start ───────────────────────────────────────────────── CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 7860 --workers 1"]