Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +23 -6
Dockerfile
CHANGED
|
@@ -16,20 +16,37 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
# rm ./google-chrome-stable_current_amd64.deb
|
| 17 |
|
| 18 |
# 设置工作目录
|
| 19 |
-
WORKDIR /app
|
| 20 |
|
| 21 |
# 克隆源代码
|
| 22 |
-
RUN git clone https://github.com/Theyka/Turnstile-Solver.git .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# 安装 Python 依赖
|
| 25 |
-
RUN pip install -r requirements.txt
|
| 26 |
|
| 27 |
# 安装 Playwright 浏览器
|
| 28 |
-
RUN python -m playwright install chromium
|
| 29 |
-
RUN python -m playwright install-deps chromium
|
| 30 |
|
| 31 |
# 暴露端口
|
| 32 |
-
EXPOSE 7860
|
| 33 |
|
| 34 |
# 启动命令
|
| 35 |
CMD ["python", "app.py"]
|
|
|
|
| 16 |
# rm ./google-chrome-stable_current_amd64.deb
|
| 17 |
|
| 18 |
# 设置工作目录
|
| 19 |
+
# WORKDIR /app
|
| 20 |
|
| 21 |
# 克隆源代码
|
| 22 |
+
RUN git clone https://github.com/Theyka/Turnstile-Solver.git .
|
| 23 |
+
|
| 24 |
+
# 创建 app.py 文件
|
| 25 |
+
RUN cat > app.py << 'EOF'
|
| 26 |
+
from api_solver import TurnstileAPIServer
|
| 27 |
+
|
| 28 |
+
app = TurnstileAPIServer(
|
| 29 |
+
headless=True,
|
| 30 |
+
useragent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
| 31 |
+
debug=False,
|
| 32 |
+
browser_type="chromium",
|
| 33 |
+
thread=1,
|
| 34 |
+
proxy_support=False
|
| 35 |
+
).app
|
| 36 |
+
|
| 37 |
+
if __name__ == "__main__":
|
| 38 |
+
app.run(host="0.0.0.0", port=7860)
|
| 39 |
+
EOF
|
| 40 |
|
| 41 |
# 安装 Python 依赖
|
| 42 |
+
RUN pip install -r requirements.txt
|
| 43 |
|
| 44 |
# 安装 Playwright 浏览器
|
| 45 |
+
RUN python -m playwright install chromium
|
| 46 |
+
RUN python -m playwright install-deps chromium
|
| 47 |
|
| 48 |
# 暴露端口
|
| 49 |
+
EXPOSE 7860
|
| 50 |
|
| 51 |
# 启动命令
|
| 52 |
CMD ["python", "app.py"]
|