fix(gensui): build the correct frontend in Dockerfile#14
Open
wstlima wants to merge 1 commit into
Open
Conversation
gensui/Dockerfile's frontend-builder stage does `COPY frontend/...`,
which only resolves to the Gensui admin UI (gensui/frontend/) if the
Docker build context is gensui/ itself. But the same Dockerfile also
does `COPY pyproject.toml ./` in the Python stage (line 23), and
pyproject.toml only exists at the repo root — not inside gensui/. A
single build context cannot satisfy both COPYs as originally written.
Building with `context: ..` (repo root) — required for the
pyproject.toml COPY to work — makes `COPY frontend/...` resolve to
shogun/repo/frontend/, which is the **main Shogun (Tenshu) frontend**,
not the Gensui admin UI. That frontend targets a different backend
(`/api/v1/*`, see frontend/src/App.tsx), while Gensui's API is
mounted under `/api/gensui/*` (gensui/app.py:98).
Effect: the container built and served *a* frontend successfully
(200 on `/`), masking the problem — but every API call from that UI
404'd, because the bundled JS was calling the wrong backend:
GET /api/v1/health -> 404 {"detail":"Not Found"}
GET /api/v1/system/notifications -> 404
GET /api/v1/setup/status -> 404
Confirmed by grepping the built JS bundle for both prefixes:
docker exec gensui grep -ro "api/gensui\|api/v1" \
/app/frontend/dist/assets/ # showed only api/v1 before the fix
Fix: reference gensui/frontend/ explicitly in both COPY instructions,
so the correct admin UI is built regardless of whether the build
context is gensui/ or the repo root.
After fix, the built bundle only references api/gensui, and the page
title changes from the Shogun Tenshu UI to "Gensui — Central Command":
docker exec gensui grep -ro "api/gensui\|api/v1" \
/app/frontend/dist/assets/ # -> api/gensui only
1 task
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.
Fixes #6
Summary
gensui/Dockerfile'sfrontend-builderstage doesCOPY frontend/..., which only resolves to the Gensui admin UI (gensui/frontend/) if the Docker build context isgensui/itself. But the same Dockerfile also doesCOPY pyproject.toml ./, andpyproject.tomlonly exists at the repo root — not insidegensui/. A single build context can't satisfy both COPYs as originally written.Building with
context: ..(repo root, required for thepyproject.tomlCOPY) makesCOPY frontend/...resolve toshogun/repo/frontend/— the main Shogun (Tenshu) frontend, not the Gensui admin UI. That frontend targets/api/v1/*, while Gensui's API is mounted under/api/gensui/*.Effect
The container built and served a frontend successfully (200 on
/, masking the problem), but every API call from that UI 404'd because the bundled JS called the wrong backend:Confirmed by grepping the built JS bundle for both prefixes — only
api/v1was present before the fix.Fix
Reference
gensui/frontend/explicitly in both COPY instructions, so the correct admin UI is built regardless of whether the build context isgensui/or the repo root.Test plan
api/gensuiafter the fix