From c2aae7e4e0cde7bfc93f74f43ba20b2a7c9ce781 Mon Sep 17 00:00:00 2001 From: Fendy Date: Wed, 16 Sep 2026 23:45:12 +0800 Subject: [PATCH] fix(frontend): copy .npmrc into docker builds, use glibc build stage npm ci in the images ran without frontend/.npmrc, so the eslint 9/10 peer conflict aborted it (legacy-peer-deps=true lives in .npmrc). The release build stage also used alpine/musl, where npm ci skipped the rolldown native bindings and vite build failed; build on glibc like dev instead. --- docs/CHANGELOG_web.md | 3 +++ frontend/Dockerfile.dev | 2 +- frontend/Dockerfile.prod | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG_web.md b/docs/CHANGELOG_web.md index d89b824..6c3b6e7 100644 --- a/docs/CHANGELOG_web.md +++ b/docs/CHANGELOG_web.md @@ -93,6 +93,9 @@ The format loosely follows Keep a Changelog and can be adapted to the team's hab ### Fixed / 修复 +- Frontend Docker builds (dev & release) work again: the Dockerfiles now copy `frontend/.npmrc` (so `npm ci` honors `legacy-peer-deps=true` instead of failing on the eslint 9/10 peer conflict), and the release build stage uses the glibc `node:22` base, where the rolldown native bindings install reliably (the alpine/musl run skipped them, breaking `vite build`). +- 前端 Docker 构建(dev/release)修复:Dockerfile 补拷 `frontend/.npmrc`(镜像内 `npm ci` 恢复遵循 `legacy-peer-deps=true`,不再因 eslint 9/10 peer 冲突失败);release 构建阶段改用 glibc 的 `node:22` 基础镜像,rolldown 原生绑定安装恢复稳定(alpine/musl 下会漏装导致 `vite build` 失败)。 + - Accessibility fixes: login screen muted text meets WCAG AA contrast in light theme (muted-foreground token darkened); the CBZ reading pane is now keyboard-scrollable (scroll container is focusable). - 无障碍修复:登录页弱化文本在亮色主题下达到 WCAG AA 对比度(muted-foreground 色值加深);CBZ 阅读面板现在可用键盘滚动(滚动容器可聚焦)。 diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev index 42184ef..07112ac 100644 --- a/frontend/Dockerfile.dev +++ b/frontend/Dockerfile.dev @@ -1,6 +1,6 @@ FROM node:22 AS dev WORKDIR /app -COPY frontend/package.json frontend/package-lock.json ./ +COPY frontend/package.json frontend/package-lock.json frontend/.npmrc ./ RUN npm ci EXPOSE 5173 CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"] diff --git a/frontend/Dockerfile.prod b/frontend/Dockerfile.prod index db00097..6df8aa0 100644 --- a/frontend/Dockerfile.prod +++ b/frontend/Dockerfile.prod @@ -1,6 +1,6 @@ -FROM node:22-alpine AS build +FROM node:22 AS build WORKDIR /src -COPY frontend/package.json frontend/package-lock.json ./ +COPY frontend/package.json frontend/package-lock.json frontend/.npmrc ./ RUN npm ci COPY frontend/ ./ RUN npm run build