bobocup commited on
Commit
b0c4f4a
·
verified ·
1 Parent(s): 3b7db0b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -6
Dockerfile CHANGED
@@ -1,19 +1,26 @@
1
  FROM ubuntu:latest
2
 
3
- # 安装 Python3 和 pip3
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  python3 \
6
  python3-pip \
 
 
7
  curl \
8
  unzip \
9
  wget \
10
- gnupg2
 
11
 
12
- # 安装 Chrome(完全按照你另一个项目的方式)
13
  RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
14
  && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
15
  && apt-get update \
16
- && apt-get install -y google-chrome-stable
 
17
 
18
  # 设置工作目录
19
  WORKDIR /app
@@ -23,8 +30,9 @@ COPY requirements.txt .
23
  COPY app.py .
24
  COPY nb4x.py .
25
 
26
- # 安装依赖
27
- RUN pip3 install -r requirements.txt
 
28
 
29
  # 暴露端口
30
  EXPOSE 7860
 
1
  FROM ubuntu:latest
2
 
3
+ # 避免交互式提示
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
+ # 安装 Python3 和 pip3 以及其他系统依赖
7
  RUN apt-get update && apt-get install -y \
8
  python3 \
9
  python3-pip \
10
+ python3-dev \
11
+ build-essential \
12
  curl \
13
  unzip \
14
  wget \
15
+ gnupg2 \
16
+ && rm -rf /var/lib/apt/lists/*
17
 
18
+ # 安装 Chrome
19
  RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
20
  && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
21
  && apt-get update \
22
+ && apt-get install -y google-chrome-stable \
23
+ && rm -rf /var/lib/apt/lists/*
24
 
25
  # 设置工作目录
26
  WORKDIR /app
 
30
  COPY app.py .
31
  COPY nb4x.py .
32
 
33
+ # 升级 pip 并安装依赖(添加 -v 查看详细输出)
34
+ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
35
+ python3 -m pip install --no-cache-dir -v -r requirements.txt
36
 
37
  # 暴露端口
38
  EXPOSE 7860