From 9631a91658ead0e4606ac80fd906b60923bc5128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Fri, 14 Aug 2026 11:08:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E7=94=A8=20hyperframes=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e8c01da..e7f91b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,17 @@ RUN npm install -g hyperframes --ignore-scripts # 安装 Chromium(提供系统级共享库依赖)和中文字体 RUN apk add --no-cache chromium font-noto-cjk fontconfig \ && fc-cache -f -# 下载 HyperFrames 需要的 headless-shell 浏览器 +# 下载 HyperFrames 需要的 headless-shell 浏览器。 +# hyperframes browser ensure 硬编码 Google CDN,国内下载不可靠; +# 先用 @puppeteer/browsers CLI 从 npmmirror 镜像预置其缓存目录 +# (hyperframes 用同一套库读该缓存,命中后 browser ensure 不再下载)。 +# 版本号必须与 hyperframes 固定版本 CHROME_VERSION 一致(hyperframes 升级需同步改)。 +# 镜像下载失败时 || true 回退,browser ensure 会改走 Google CDN。 +RUN node /usr/local/lib/node_modules/hyperframes/node_modules/@puppeteer/browsers/lib/main-cli.js install \ + chrome-headless-shell@152.0.7928.2 \ + --path /root/.cache/hyperframes/chrome \ + --base-url https://npmmirror.com/mirrors/chrome-for-testing \ + || true RUN npx hyperframes browser ensure WORKDIR /app