Fix: Docker deployment issue with frontend resources#240
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to resolve Docker deployments missing/breaking the admin console frontend by building the React (Umi) UI during the Docker image build and copying the generated dist assets into the ASP.NET app’s wwwroot/ui folder. It also aligns several UI locale imports to use umi exports and normalizes the init-password route casing for Linux/container environments.
Changes:
- Add a dedicated Docker build stage for the React UI and copy
distintoAgileConfig.Server.Apisite/wwwroot/ui. - Switch several
useIntl/getIntl/getLocaleimports to come fromumiinstead of Umi-generated temp paths /react-intl. - Normalize init-password navigation/redirect path to
/user/initPassword.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/AgileConfig.Server.UI/react-ui-antd/src/pages/User/login/index.tsx | Adjusts init-password redirect route casing. |
| src/AgileConfig.Server.UI/react-ui-antd/src/pages/User/comps/updateUser.tsx | Updates useIntl import to umi. |
| src/AgileConfig.Server.UI/react-ui-antd/src/pages/Configs/index.tsx | Consolidates intl imports to umi. |
| src/AgileConfig.Server.UI/react-ui-antd/src/pages/Apps/comps/userAuth.tsx | Updates useIntl import to umi. |
| src/AgileConfig.Server.UI/react-ui-antd/src/pages/Apps/comps/updateForm.tsx | Updates useIntl import to umi. |
| src/AgileConfig.Server.Apisite/Controllers/HomeController.cs | Updates init-password redirect route casing. |
| Dockerfile | Adds UI build stage and copies built assets into server wwwroot/ui. |
| .gitignore | Ignores local .worktrees/ directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| WORKDIR /app | ||
| EXPOSE 5000 | ||
|
|
||
| FROM node:16 AS ui-build |
|
@copilot 如果前端代码也在docker镜像构建的时候build,那我原本来 workflow 里编译前端的步骤是不是不需要了? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Reviewed the diff. All three fixes are correct and address real breakage — thanks for this. Verified as genuine bugs:
Two things I'd like addressed before merge:
Minor:
Testing: none added, and realistically none is warranted for build plumbing plus two string fixes. The meaningful check is a Security: nothing introduced; Approve with the two follow-ups above. |
|
Thanks for your contribution |
The Dockerfile now builds the React admin UI itself in a dedicated ui-build stage (added in dotnetcore#240), so building it again in a separate CI job and shipping the result via artifact was doing the same work twice per release — and the in-Docker build silently won anyway. Dropping the CI job leaves a single UI build path and keeps 'docker build .' reproducible outside of CI. master-ci / master-pr-ci keep their build-reactapp job: those are compile-only checks that gate frontend errors on PRs and never produce an artifact. release-xxx keeps its job too, since its zip release artifact comes from 'dotnet publish' and never goes through Docker.
No description provided.