Spaces:
Sleeping
Sleeping
fix: playwright
Browse files- Dockerfile +24 -6
Dockerfile
CHANGED
|
@@ -1,10 +1,28 @@
|
|
| 1 |
-
|
| 2 |
-
FROM ghcr.io/huggingface/playwright-python:latest
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
#
|
|
|
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
# Install dependencies
|
|
@@ -13,5 +31,5 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 13 |
# HuggingFace requires port 7860
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
-
# Start FastAPI
|
| 17 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
|
|
|
| 2 |
|
| 3 |
+
# Install system dependencies for Playwright
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
wget \
|
| 6 |
+
libnss3 \
|
| 7 |
+
libatk1.0-0 \
|
| 8 |
+
libatk-bridge2.0-0 \
|
| 9 |
+
libcups2 \
|
| 10 |
+
libxkbcommon0 \
|
| 11 |
+
libxcomposite1 \
|
| 12 |
+
libxdamage1 \
|
| 13 |
+
libxrandr2 \
|
| 14 |
+
libgbm1 \
|
| 15 |
+
libpango-1.0-0 \
|
| 16 |
+
libcairo2 \
|
| 17 |
+
libasound2 \
|
| 18 |
+
libxshmfence1 \
|
| 19 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
+
|
| 21 |
+
# Install python packages and playwright
|
| 22 |
+
RUN pip install --no-cache-dir playwright && playwright install chromium
|
| 23 |
|
| 24 |
+
# App folder
|
| 25 |
+
WORKDIR /app
|
| 26 |
COPY . /app
|
| 27 |
|
| 28 |
# Install dependencies
|
|
|
|
| 31 |
# HuggingFace requires port 7860
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
+
# Start FastAPI app
|
| 35 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|