bobocup commited on
Commit
844ff87
·
verified ·
1 Parent(s): d694498

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # 安装Chrome和必要依赖
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ unzip \
8
+ xvfb \
9
+ chromium \
10
+ chromium-driver
11
+
12
+ # 设置工作目录
13
+ WORKDIR /app
14
+
15
+ # 复制需要的文件
16
+ COPY requirements.txt .
17
+ COPY nb2.py .
18
+
19
+ # 安装Python依赖
20
+ RUN pip install -r requirements.txt
21
+
22
+ # 设置环境变量
23
+ ENV DISPLAY=:99
24
+ ENV CHROME_BIN=/usr/bin/chromium
25
+ ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
26
+
27
+ # 启动脚本
28
+ CMD ["python", "nb2.py"]