StarrySkyWorld commited on
Commit
535520f
·
verified ·
1 Parent(s): 90f3bea

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -0
Dockerfile ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # 设置工作目录
4
+ WORKDIR /app
5
+
6
+ # 安装系统依赖
7
+ RUN apt-get update && apt-get install -y \
8
+ wget \
9
+ gnupg \
10
+ libnss3 \
11
+ libatk1.0-0 \
12
+ libatk-bridge2.0-0 \
13
+ libcups2 \
14
+ libdrm2 \
15
+ libxkbcommon0 \
16
+ libxcomposite1 \
17
+ libxdamage1 \
18
+ libxfixes3 \
19
+ libxrandr2 \
20
+ libgbm1 \
21
+ libasound2 \
22
+ libpango-1.0-0 \
23
+ libcairo2 \
24
+ libatspi2.0-0 \
25
+ && rm -rf /var/lib/apt/lists/*
26
+
27
+ # 安装Python依赖
28
+ COPY requirements.txt .
29
+ RUN pip install --no-cache-dir -r requirements.txt
30
+
31
+ # 安装Playwright浏览器
32
+ RUN playwright install chromium
33
+
34
+ # 复制应用文件
35
+ COPY main.py .
36
+ COPY config.json .
37
+ COPY cookies.json* ./
38
+
39
+ # 暴露端口
40
+ EXPOSE 8000
41
+
42
+ # 启动应用
43
+ CMD ["python", "main.py"]