File size: 1,644 Bytes
535520f
 
 
 
 
474eb06
 
 
 
 
535520f
 
 
1581ce7
535520f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66430a9
 
 
 
 
474eb06
66430a9
 
535520f
474eb06
 
 
 
 
 
 
 
 
 
 
535520f
 
 
474eb06
535520f
 
 
 
 
 
c848601
474eb06
 
 
535520f
 
474eb06
535520f
474eb06
 
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM python:3.11-slim

# 设置工作目录
WORKDIR /app

# 设置环境变量
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONIOENCODING=utf-8

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    wget \
    curl \
    gnupg \
    libnss3 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libcups2 \
    libdrm2 \
    libxkbcommon0 \
    libxcomposite1 \
    libxdamage1 \
    libxfixes3 \
    libxrandr2 \
    libgbm1 \
    libasound2 \
    libpango-1.0-0 \
    libcairo2 \
    libatspi2.0-0 \
    fonts-noto-cjk \
    fonts-noto-cjk-extra \
    fonts-wqy-zenhei \
    fonts-wqy-microhei \
    fontconfig \
    supervisor \
    && rm -rf /var/lib/apt/lists/* \
    && fc-cache -fv

# 下载 wgcf(用于注册 WARP 并生成 WireGuard 配置)
RUN wget -O /usr/local/bin/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.22/wgcf_2.2.22_linux_amd64 \
    && chmod +x /usr/local/bin/wgcf

# 下载 wireproxy(用户空间 WireGuard 代理,无需 TUN)
RUN wget -O /tmp/wireproxy.tar.gz https://github.com/pufferffish/wireproxy/releases/download/v1.0.9/wireproxy_linux_amd64.tar.gz \
    && tar -xzf /tmp/wireproxy.tar.gz -C /usr/local/bin/ \
    && chmod +x /usr/local/bin/wireproxy \
    && rm /tmp/wireproxy.tar.gz

# 安装 Python 依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 安装 Playwright 浏览器
RUN playwright install chromium

# 复制应用文件
COPY main.py .
COPY config.json .
COPY cookies.json* ./
COPY start.sh .
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN chmod +x start.sh

# 暴露端口
EXPOSE 7860

# 启动
CMD ["sh", "start.sh"]