fix: 修改.dockerignore 以修复 Docker 构建失败因为前端 node_modules 符号链接问题#33
Merged
mirrorange merged 1 commit intomirrorange:mainfrom Dec 13, 2025
Merged
Conversation
.dockerignore 的 node_modules/ 规则无法匹配子目录,导致本地 Windows 的 front/node_modules(含 pnpm 符号链接)被复制到 Linux 容器中覆盖已安装的依赖,造成 TypeScript 模块找不到。 改用 **/node_modules/ 通配符匹配所有子目录。 (cherry picked from commit aee48c7)
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.
Summary
Cannot find module 'typescript/bin/tsc'错误.dockerignore中的node_modules/改为**/node_modules/Problem
Docker 构建流程:
pnpm install在容器中正确安装依赖COPY front/ ./意外复制了本地 Windows 的front/node_modules/C:/program/...)在 Linux 容器中断开pnpm run build执行tsc时找不到模块根本原因:
.dockerignore的node_modules/规则仅匹配根目录,不匹配front/node_modules/