FROM python:3.9-slim # 安装必要的依赖 RUN apt-get update && apt-get install -y \ wget \ gnupg \ unzip \ curl \ xvfb \ git \ && rm -rf /var/lib/apt/lists/* # 直接下载并安装 Chrome # RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ # apt-get install -y ./google-chrome-stable_current_amd64.deb && \ # rm ./google-chrome-stable_current_amd64.deb # 设置工作目录 WORKDIR /app # 克隆源代码到临时目录,然后移动文件 RUN git clone https://github.com/Theyka/Turnstile-Solver.git temp && \ mv temp/* . && \ mv temp/.* . 2>/dev/null || true && \ rm -rf temp # 安装 Python 依赖 RUN pip install -r requirements.txt # 安装 Playwright 浏览器 RUN playwright install chromium RUN playwright install-deps chromium RUN playwright install chrome # 暴露端口 EXPOSE 7860 # 启动命令 - 直接使用 api_solver.py CMD ["python", "api_solver.py", "--headless", "True", "--useragent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "--host", "0.0.0.0", "--port", "7860", "--browser_type", "chrome"]