StarrySkyWorld commited on
Commit
60f1d66
·
verified ·
1 Parent(s): f2f3148

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +47 -0
Dockerfile ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用 Python 3.10 基础镜像
2
+ FROM python:3.10-slim
3
+
4
+ # 安装系统库、wget 和 unzip
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ unzip \
8
+ libgtk-3-0 \
9
+ libdbus-glib-1-2 \
10
+ libxt6 \
11
+ libx11-xcb1 \
12
+ libasound2 \
13
+ libglib2.0-0 \
14
+ libnss3 \
15
+ libxcomposite1 \
16
+ libxdamage1 \
17
+ libxext6 \
18
+ libxfixes3 \
19
+ libxrandr2 \
20
+ libgbm1 \
21
+ libpango-1.0-0 \
22
+ libcairo2 \
23
+ && rm -rf /var/lib/apt/lists/*
24
+
25
+ # 设置工作目录
26
+ WORKDIR /app
27
+
28
+ # 1. 下载压缩包
29
+ # 2. 解压到当前目录
30
+ # 3. 删除压缩包以节省空间
31
+ RUN wget https://source.starrysky.ggff.net/hf/solver.zip -O solver.zip && \
32
+ unzip solver.zip -d . && \
33
+ rm solver.zip
34
+
35
+ # 安装 Python 依赖
36
+ # 注意:确保 zip 包根目录下有 requirements.txt
37
+ RUN pip install --no-cache-dir -r requirements.txt
38
+
39
+ # 提前下载 Camoufox 浏览器二进制文件
40
+ RUN python -m camoufox fetch
41
+
42
+ # 暴露 HF 默认端口
43
+ EXPOSE 7860
44
+
45
+ # 启动命令
46
+ # 注意:确保 zip 包解压后根目录下有 api_solver.py
47
+ CMD ["python", "api_solver.py", "--host", "0.0.0.0", "--port", "7860", "--browser_type", "camoufox", "--thread", "2", "--debug"]