fix: repair Docker image build and clean production audit - #216
Open
libertydragonn wants to merge 1 commit into
Open
libertydragonn wants to merge 1 commit into
libertydragonn wants to merge 1 commit into
Conversation
- Move production audit fixes into pnpm overrides (pnpm-workspace.yaml) and refresh the lockfile so pnpm audit --prod is clean. - Copy pnpm-workspace.yaml into the Docker deps stage: without it pnpm install --frozen-lockfile fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH and the image cannot build. - Pin pnpm in the Dockerfile to the packageManager version (10.14.0) instead of latest so image builds stay reproducible. - Ignore node_modules/.next/.git in .dockerignore so a host checkout's (possibly non-Linux) node_modules can't clobber the image's installed dependencies during COPY.
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
这是把之前 #214 / #215 拆小重做的第 1 个 PR,只包含依赖审计和 Docker 构建修复,不含任何 auth / 播放 / spider 改动,方便单独 review 和合并。基于当前最新
main重新开分支。问题
之前 #214 把生产审计的 pnpm
overrides放进了新增的pnpm-workspace.yaml,但 Dockerfile 的 deps 阶段只COPY package.json pnpm-lock.yaml,没有拷贝pnpm-workspace.yaml。结果容器内pnpm install --frozen-lockfile直接报错,镜像无法构建:改动
overrides形式放在pnpm-workspace.yaml,并刷新 lockfile,使pnpm audit --prod干净。COPY ... pnpm-workspace.yaml,否则pnpm install --frozen-lockfile失败、镜像构建不出来。latest固定到packageManager声明的版本(10.14.0),保证镜像构建可复现。.dockerignore增加node_modules/.next/.git:否则宿主机 checkout 里(可能是非 Linux 的)node_modules会在COPY . .时覆盖镜像里已正确安装的依赖,导致next build报Cannot find module next。验证(真实 Docker 部署)
docker build -t decotv-test .— 成功(修复前会在 deps 阶段因 lockfile mismatch 失败)。docker run该镜像 + kvrocks,实测登录链路:200,错误密码 →401200pnpm audit --prod— 通过pnpm typecheck— 通过pnpm build— 通过说明
这个 PR 只修构建和依赖,行为上不改变登录/鉴权逻辑,属于低风险基础修复。后续 auth cookie、密码哈希、SSRF、spider.jar、播放探测等会各自拆成独立 PR,并附各自的 Docker 部署验证结果。