File size: 898 Bytes
5feb7c0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
FROM python:3.10-slim
# --- System deps required by Playwright browsers ---
RUN apt-get update && apt-get install -y \
wget gnupg ca-certificates curl unzip \
libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 \
libgtk-3-0 libgbm1 libasound2 libxcomposite1 libxdamage1 libxrandr2 \
libxfixes3 libpango-1.0-0 libcairo2 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# --- Install Playwright + Chromium ---
RUN pip install playwright && playwright install --with-deps chromium
# --- Install uv package manager ---
RUN pip install uv
# --- Copy app to container ---
WORKDIR /app
COPY . .
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=utf-8
# --- Install project dependencies using uv ---
RUN uv sync --frozen
# HuggingFace Spaces exposes port 7860
EXPOSE 7860
# --- Run your FastAPI app ---
# uvicorn must be in pyproject dependencies
CMD ["uv", "run", "main.py"]
|