Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +15 -0
Dockerfile
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# Install system dependencies (fixes the ffmpeg warning and helps browsers run)
|
| 4 |
+
RUN apt-get update && apt-get install -y ffmpeg curl libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libasound2 && rm -rf /var/lib/apt/lists/*
|
| 5 |
+
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
# Install g4f and the browser drivers it needs to bypass web protections
|
| 9 |
+
RUN pip install --no-cache-dir g4f[all] fastapi uvicorn curl_cffi playwright
|
| 10 |
+
RUN playwright install --with-deps chromium
|
| 11 |
+
|
| 12 |
+
EXPOSE 7860
|
| 13 |
+
|
| 14 |
+
# THE FIX: Use --bind with the colon format
|
| 15 |
+
CMD ["g4f", "api", "--bind", "0.0.0.0:7860"]
|