bobocup commited on
Commit
e2cb105
·
verified ·
1 Parent(s): 4acfcff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -7
Dockerfile CHANGED
@@ -1,18 +1,25 @@
1
  FROM ubuntu:latest
2
 
3
- # 安装 Python 和 pip
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  python3 \
6
  python3-pip \
7
  wget \
8
  gnupg \
9
- curl
 
 
 
10
 
11
  # 安装 Chrome
12
  RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
13
  && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
14
  && apt-get update \
15
- && apt-get install -y google-chrome-stable
 
16
 
17
  # 设置工作目录
18
  WORKDIR /app
@@ -22,15 +29,16 @@ COPY requirements.txt .
22
  COPY app.py .
23
  COPY nb4x.py .
24
 
25
- # 安装Python依赖
26
- RUN pip3 install -r requirements.txt
 
27
 
28
  # 暴露端口
29
  EXPOSE 7860
30
 
31
  # 创建启动脚本
32
- RUN echo '#!/bin/bash\npython3 app.py & python3 nb4x.py' > start.sh
33
- RUN chmod +x start.sh
34
 
35
  # 启动命令
36
  CMD ["./start.sh"]
 
1
  FROM ubuntu:latest
2
 
3
+ # 避免交互式提示
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
+ # 安装 Python 和其他必要的系统依赖
7
  RUN apt-get update && apt-get install -y \
8
  python3 \
9
  python3-pip \
10
  wget \
11
  gnupg \
12
+ curl \
13
+ build-essential \
14
+ python3-dev \
15
+ && rm -rf /var/lib/apt/lists/*
16
 
17
  # 安装 Chrome
18
  RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
19
  && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
20
  && apt-get update \
21
+ && apt-get install -y google-chrome-stable \
22
+ && rm -rf /var/lib/apt/lists/*
23
 
24
  # 设置工作目录
25
  WORKDIR /app
 
29
  COPY app.py .
30
  COPY nb4x.py .
31
 
32
+ # 升级 pip 并安装依赖
33
+ RUN python3 -m pip install --upgrade pip && \
34
+ python3 -m pip install -r requirements.txt
35
 
36
  # 暴露端口
37
  EXPOSE 7860
38
 
39
  # 创建启动脚本
40
+ RUN echo '#!/bin/bash\npython3 app.py & python3 nb4x.py' > start.sh && \
41
+ chmod +x start.sh
42
 
43
  # 启动命令
44
  CMD ["./start.sh"]