Spaces:
No application file
No application file
File size: 670 Bytes
afc2ab4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# ---- base image ----
FROM python:3.11-slim
# 1) system deps needed by Playwright/Chromium
RUN apt-get update && apt-get install -y --no-install-recommends \
wget gnupg ca-certificates libnss3 libatk-bridge2.0-0 libgtk-3-0 \
libdrm2 libgbm1 libxtst6 libxdamage1 libxfixes3 libxcomposite1 \
libxrandr2 libasound2 libcurl4 xvfb && \
rm -rf /var/lib/apt/lists/*
# 2) python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3) install Chromium for Playwright
RUN playwright install chromium
# 4) fastapi entry-point
COPY app.py .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|