| FROM python:3.10-slim |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| git wget curl unzip \ |
| libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ |
| libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ |
| libgbm1 libasound2 libpango-1.0-0 libcairo2 libgtk-3-0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN git clone https://github.com/CloudWaddie/LMArenaBridge.git . |
|
|
| |
| |
| RUN python3 -c 'import os; p = "src/main.py"; c = open(p).read(); c = c.replace("8000", "7860"); c = c.replace("timeout=45000", "timeout=120000"); old_code = "token = await page.evaluate"; new_code = "await asyncio.sleep(5); await page.wait_for_load_state(\"networkidle\"); token = await page.evaluate"; c = c.replace(old_code, new_code); c = c.replace("window.grecaptcha.enterprise.execute", "await page.wait_for_function(\"() => window.grecaptcha?.enterprise?.execute\"); await window.grecaptcha.enterprise.execute"); open(p, "w").write(c); print("✅ 深度修复补丁已应用");' |
|
|
| |
| RUN echo '{"admin_password": "123456", "password": "123456"}' > config.json |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip |
| RUN pip install --no-cache-dir -r requirements.txt |
| |
| RUN pip install --no-cache-dir camoufox[geoip] playwright python-multipart httpx |
|
|
| |
| RUN playwright install chromium |
| RUN playwright install-deps chromium |
|
|
| |
| RUN python -m camoufox fetch |
| RUN chmod +x src/main.py |
|
|
| |
| ENV PYTHONUNBUFFERED=1 |
| ENV PORT=7860 |
|
|
| CMD ["python", "src/main.py"] |