File size: 625 Bytes
7002eb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
FROM python:3.10-slim

# Install system dependencies (fixes the ffmpeg warning and helps browsers run)
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/*

WORKDIR /app

# Install g4f and the browser drivers it needs to bypass web protections
RUN pip install --no-cache-dir g4f[all] fastapi uvicorn curl_cffi playwright
RUN playwright install --with-deps chromium

EXPOSE 7860

# THE FIX: Use --bind with the colon format
CMD ["g4f", "api", "--bind", "0.0.0.0:7860"]