Repository navigation
fix(ci): build web assets inside Docker image - #35
Merged
Merged
Conversation
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.
背景
PR #34 合并后的
main提交8110196在Docker Image CI中构建失败:COPY ["web/dist/", "src/FastGateway/wwwroot/"]无法找到web/distweb/dist并不存在另外,前端依赖当前会触发 peer dependency 冲突:
@lobehub/ui@2.25.0要求antd@^6.1.1antd@5.29.3因此仅恢复 Docker 前端阶段仍会在
npm install阶段失败。修复内容
node:22-slim$BUILDPLATFORM上执行一次前端构建COPY --from=web /web/dist将产物复制到wwwrootnpm install --legacy-peer-deps,兼容当前依赖树。--legacy-peer-deps,避免发布流程出现同样问题。验证
npm install --legacy-peer-deps:通过npm run build:通过dotnet test tests/FastGateway.Tests/FastGateway.Tests.csproj -c Release:238/238通过git diff --check:通过本地宿主机 Docker 环境存在 APT 签名缓存和磁盘空间问题,未能完成完整 Native AOT 镜像构建;修复后的 Dockerfile 已通过等价的前端依赖安装和生产构建验证,最终双架构结果以 GitHub Actions 为准。
影响范围
仅影响 CI/Docker 镜像的前端资源构建方式,不涉及运行时功能变更。修复后,CI 不再依赖开发者本地生成
web/dist,也不会因当前前端 peer dependency 解析而失败。