forked from foxhui/WebAI2API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 856 Bytes
/
Dockerfile
File metadata and controls
38 lines (31 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM node:22-bookworm
WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
# 1. 安装系统依赖
RUN apt-get update && apt-get install -y \
xvfb \
x11vnc \
libasound2 \
libatk-bridge2.0-0 \
libgtk-3-0 \
libnss3 \
libx11-xcb1 \
libxss1 \
libxtst6 \
libgbm1 \
libdbus-glib-1-2 \
python3 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# 2. 复制依赖文件、脚本和补丁目录,然后安装
COPY package.json pnpm-lock.yaml ./
COPY scripts/ ./scripts/
COPY patches/ ./patches/
RUN npm install -g pnpm && pnpm install --frozen-lockfile
# 3. 复制源码并初始化
COPY . .
RUN npm run init
EXPOSE 3000 5900
# 4. 启动服务(配置文件会自动从 config.example.yaml 复制到 data/config.yaml)
CMD ["npm", "start", "--", "-xvfb", "-vnc"]