StarrySkyWorld commited on
Commit
474eb06
·
verified ·
1 Parent(s): 47e60b8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -6
Dockerfile CHANGED
@@ -3,6 +3,11 @@ FROM python:3.11-slim
3
  # 设置工作目录
4
  WORKDIR /app
5
 
 
 
 
 
 
6
  # 安装系统依赖
7
  RUN apt-get update && apt-get install -y \
8
  wget \
@@ -28,15 +33,25 @@ RUN apt-get update && apt-get install -y \
28
  fonts-wqy-zenhei \
29
  fonts-wqy-microhei \
30
  fontconfig \
 
31
  && rm -rf /var/lib/apt/lists/* \
32
- # 刷新字体缓存
33
  && fc-cache -fv
34
 
35
- # 安装Python依赖
 
 
 
 
 
 
 
 
 
 
36
  COPY requirements.txt .
37
  RUN pip install --no-cache-dir -r requirements.txt
38
 
39
- # 安装Playwright浏览器
40
  RUN playwright install chromium
41
 
42
  # 复制应用文件
@@ -44,9 +59,12 @@ COPY main.py .
44
  COPY config.json .
45
  COPY cookies.json* ./
46
  COPY start.sh .
 
 
 
47
 
48
  # 暴露端口
49
- EXPOSE 8000
50
 
51
- # 启动应用
52
- CMD ["sh","start.sh"]
 
3
  # 设置工作目录
4
  WORKDIR /app
5
 
6
+ # 设置环境变量
7
+ ENV LANG=C.UTF-8
8
+ ENV LC_ALL=C.UTF-8
9
+ ENV PYTHONIOENCODING=utf-8
10
+
11
  # 安装系统依赖
12
  RUN apt-get update && apt-get install -y \
13
  wget \
 
33
  fonts-wqy-zenhei \
34
  fonts-wqy-microhei \
35
  fontconfig \
36
+ supervisor \
37
  && rm -rf /var/lib/apt/lists/* \
 
38
  && fc-cache -fv
39
 
40
+ # 下载 wgcf(用于注册 WARP 并生成 WireGuard 配置)
41
+ RUN wget -O /usr/local/bin/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.22/wgcf_2.2.22_linux_amd64 \
42
+ && chmod +x /usr/local/bin/wgcf
43
+
44
+ # 下载 wireproxy(用户空间 WireGuard 代理,无需 TUN)
45
+ RUN wget -O /tmp/wireproxy.tar.gz https://github.com/pufferffish/wireproxy/releases/download/v1.0.9/wireproxy_linux_amd64.tar.gz \
46
+ && tar -xzf /tmp/wireproxy.tar.gz -C /usr/local/bin/ \
47
+ && chmod +x /usr/local/bin/wireproxy \
48
+ && rm /tmp/wireproxy.tar.gz
49
+
50
+ # 安装 Python 依赖
51
  COPY requirements.txt .
52
  RUN pip install --no-cache-dir -r requirements.txt
53
 
54
+ # 安装 Playwright 浏览器
55
  RUN playwright install chromium
56
 
57
  # 复制应用文件
 
59
  COPY config.json .
60
  COPY cookies.json* ./
61
  COPY start.sh .
62
+ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
63
+
64
+ RUN chmod +x start.sh
65
 
66
  # 暴露端口
67
+ EXPOSE 7860
68
 
69
+ # 启动
70
+ CMD ["sh", "start.sh"]