File size: 1,247 Bytes
a75262f
 
1937618
a75262f
 
 
 
 
 
5bb82b1
a75262f
 
5bb82b1
93b1146
 
 
a75262f
 
c7be5fb
a75262f
c7be5fb
 
 
 
 
5bb82b1
 
f662128
a75262f
 
5588434
 
3991577
a75262f
 
f662128
a75262f
e6f0240
9284788
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
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"]