File size: 1,658 Bytes
d221c98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4312ad5
 
 
d221c98
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM python:3.13

# Install system dependencies for Playwright + Node.js (for MCP servers)
RUN apt-get update && apt-get install -y \
    git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1 \
    libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
    libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
    libgbm1 libpango-1.0-0 libcairo2 libasound2 \
    curl \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

# Install Node.js 20.x (required for MCP servers — most are npm packages)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs \
    && node --version \
    && npm --version

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir pip -U && \
    pip install --no-cache-dir \
    datasets "huggingface-hub>=0.30" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1"

RUN pip install --no-cache-dir -r requirements.txt \
    gradio[oauth]==4.44.1 "uvicorn>=0.14.0" "websockets>=10.4" spaces

# Install curl_cffi for Chrome TLS fingerprint spoofing (Signal #51)
RUN pip install --no-cache-dir curl_cffi

# Install Playwright browsers
RUN playwright install chromium
RUN playwright install-deps chromium || true

# Install patchright browsers (undetected Playwright fork for Turnstile bypass)
RUN patchright install chromium || playwright install chromium

# Pre-install popular MCP servers (cached for faster startup)
RUN npm install -g @anthropic/github-mcp 2>/dev/null || true
RUN npm install -g @anthropic/filesystem-mcp 2>/dev/null || true

COPY . .

EXPOSE 7860
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860

CMD ["python", "app.py"]