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