Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ===============================
|
| 2 |
+
# 🐳 Dockerfile for Hugging Face Spaces - FastAPI + Playwright
|
| 3 |
+
# ===============================
|
| 4 |
+
|
| 5 |
+
FROM python:3.10-slim
|
| 6 |
+
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
|
| 9 |
+
# Install system dependencies for Playwright + fonts
|
| 10 |
+
RUN apt-get update && apt-get install -y \
|
| 11 |
+
wget gnupg ca-certificates curl unzip \
|
| 12 |
+
libxkbcommon0 libnss3 libatk1.0-0 libatk-bridge2.0-0 \
|
| 13 |
+
libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 \
|
| 14 |
+
libasound2 libxshmfence1 libxext6 libxfixes3 libdrm2 \
|
| 15 |
+
fonts-liberation libappindicator3-1 libnspr4 libx11-xcb1 libxrender1 \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Copy dependencies and install them
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# ✅ Install Playwright Chromium
|
| 23 |
+
RUN pip install --no-cache-dir playwright
|
| 24 |
+
RUN playwright install --with-deps chromium
|
| 25 |
+
|
| 26 |
+
# Copy the rest of your app
|
| 27 |
+
COPY . .
|
| 28 |
+
|
| 29 |
+
# Hugging Face Spaces expects apps on port 7860
|
| 30 |
+
EXPOSE 7860
|
| 31 |
+
|
| 32 |
+
# Run FastAPI app
|
| 33 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|