BG5 commited on
Commit
e65409b
·
verified ·
1 Parent(s): d3346e5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile CHANGED
@@ -1,7 +1,28 @@
1
  FROM python:3.11
2
 
3
  WORKDIR /code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
 
 
 
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
  RUN python3 -m pip install --no-cache-dir --upgrade pip
7
  RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
1
  FROM python:3.11
2
 
3
  WORKDIR /code
4
+ # 安装 Chrome 和必要的依赖
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ gnupg \
8
+ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
9
+ && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
10
+ && apt-get update && apt-get install -y \
11
+ google-chrome-stable \
12
+ fonts-ipafont-gothic \
13
+ fonts-wqy-zenhei \
14
+ fonts-thai-tlwg \
15
+ fonts-khmeros \
16
+ fonts-freefont-ttf \
17
+ libxss1 \
18
+ --no-install-recommends \
19
+ && rm -rf /var/lib/apt/lists/*
20
 
21
+ # 验证 Chrome 版本
22
+ RUN google-chrome --version
23
+ RUN useradd -m -u 1000 user
24
+ USER user
25
+ ENV PATH="/home/user/.local/bin:$PATH"
26
  COPY ./requirements.txt /code/requirements.txt
27
  RUN python3 -m pip install --no-cache-dir --upgrade pip
28
  RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt