Skip to content

Commit 5dd5253

Browse files
committed
chore: update Dockerfile to install Chromium and skip Puppeteer download
1 parent 0d1478d commit 5dd5253

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
shamefully-hoist=true
22
registry="https://registry.npmmirror.com"
3-
PUPPETEER_DOWNLOAD_BASE_URL="https://cdn.npmmirror.com/binaries/chrome-for-testing"
3+
# PUPPETEER_DOWNLOAD_BASE_URL="https://cdn.npmmirror.com/binaries/chrome-for-testing"

docker/sili-core.dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,16 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
4949
# 将 bun 添加到 PATH
5050
ENV PATH="/root/.bun/bin:${PATH}"
5151

52-
# 安装 Node.js 依赖
53-
COPY package.json bun.lock .npmrc ./
54-
RUN bun install --frozen-lockfile
55-
56-
# 安装 Chrome
57-
VOLUME /root/.cache/puppeteer
58-
# https://pptr.nodejs.cn/guides/configuration
59-
# RUN pnpm dlx puppeteer browsers install chrome
60-
# 我们的项目依赖本身就包含了 puppeteer,所以我们不需要 dlx 浪费时间
61-
RUN bun puppeteer browsers install chrome
52+
# 安装 Chromium
53+
RUN apt-clean-install chromium-browser
6254
# https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/dist_package_versions.json
6355
RUN apt-clean-install \
6456
libasound2t64 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libdrm2 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libudev1 libuuid1 libx11-6 libx11-xcb1 libxcb-dri3-0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxkbcommon0 libxrandr2 libxrender1 libxshmfence1 libxss1 libxtst6
6557

58+
# 安装 Node.js 依赖
59+
COPY package.json bun.lock .npmrc ./
60+
ENV PUPPETEER_SKIP_DOWNLOAD=true
61+
RUN bun install --frozen-lockfile
62+
6663
# SILI,启动!
6764
CMD ["bun", "start"]

0 commit comments

Comments
 (0)