MoYang303 commited on
Commit
d200cd9
·
verified ·
1 Parent(s): 117848b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -7
Dockerfile CHANGED
@@ -6,14 +6,34 @@ ARG APT_PACKAGES=""
6
  ARG PIP_PACKAGES="matplotlib jmcomic browser_cookie3 img2pdf kwmatcher aiosqlite playwright"
7
 
8
  USER root
9
- # 使用apt
10
- RUN apt-get update && apt-get install -y git jq curl ${APT_PACKAGES}
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- # 安装额外的pip包
14
  RUN if [ ! -z "${PIP_PACKAGES}" ]; then pip install ${PIP_PACKAGES}; fi
15
 
16
- # 安装Playwright浏览器
17
- RUN playwright install \
18
- && playwright install-deps \
19
- && playwright install firefox
 
6
  ARG PIP_PACKAGES="matplotlib jmcomic browser_cookie3 img2pdf kwmatcher aiosqlite playwright"
7
 
8
  USER root
 
 
9
 
10
+ # 1. 安装系统依赖
11
+ RUN apt-get update && apt-get install -y \
12
+ git \
13
+ jq \
14
+ curl \
15
+ libnss3 \
16
+ libnspr4 \
17
+ libatk1.0-0 \
18
+ libatk-bridge2.0-0 \
19
+ libcups2 \
20
+ libdrm2 \
21
+ libxkbcommon0 \
22
+ libxcomposite1 \
23
+ libxdamage1 \
24
+ libxfixes3 \
25
+ libxrandr2 \
26
+ libgbm1 \
27
+ libasound2 \
28
+ libatspi2.0-0 \
29
+ libwayland-client0 \
30
+ ${APT_PACKAGES} \
31
+ && rm -rf /var/lib/apt/lists/*
32
 
33
+ # 2. 安装Python依赖
34
  RUN if [ ! -z "${PIP_PACKAGES}" ]; then pip install ${PIP_PACKAGES}; fi
35
 
36
+ # 3. 安装Playwright浏览器(明确指定用户目录)
37
+ ENV PLAYWRIGHT_BROWSERS_PATH=/app/ms-playwright
38
+ RUN playwright install --with-deps firefox \
39
+ && chmod -R 777 /app/ms-playwright