File size: 783 Bytes
844ff87
 
2f200f9
844ff87
 
 
 
fc79aad
 
 
 
 
 
 
2f200f9
 
 
844ff87
 
 
 
 
 
 
 
 
 
 
 
 
 
2f200f9
844ff87
2108a15
0d67290
b5f2541
0d67290
fc79aad
844ff87
0d67290
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
FROM python:3.9-slim

# 安装必要的系统依赖
RUN apt-get update && apt-get install -y \
    wget \
    gnupg \
    chromium \
    chromium-driver \
    libgconf-2-4 \
    libnss3 \
    libxss1 \
    libasound2 \
    libatk-bridge2.0-0 \
    libgtk-3-0 \
    libgbm1 \
    fonts-liberation \
    && rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /app

# 复制需要的文件
COPY requirements.txt .
COPY nb2.py .

# 安装Python依赖
RUN pip install -r requirements.txt

# 设置环境变量
ENV CHROME_BIN=/usr/bin/chromium
ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
ENV PYTHONUNBUFFERED=1

# 创建必要的目录和文件
RUN mkdir -p /tmp/chrome-data && \
    touch /app/cookies.txt && \
    chmod 777 /app/cookies.txt

# 启动脚本
CMD ["python", "nb2.py"]