Skip to content

fix(gensui): build the correct frontend in Dockerfile#14

Open
wstlima wants to merge 1 commit into
AlphaHorizon-AI:mainfrom
wstlima:fix/gensui-dockerfile-wrong-frontend
Open

fix(gensui): build the correct frontend in Dockerfile#14
wstlima wants to merge 1 commit into
AlphaHorizon-AI:mainfrom
wstlima:fix/gensui-dockerfile-wrong-frontend

Conversation

@wstlima

@wstlima wstlima commented Jul 10, 2026

Copy link
Copy Markdown

Fixes #6

Summary

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 ./, and pyproject.toml only exists at the repo root — not inside gensui/. A single build context can't satisfy both COPYs as originally written.

Building with context: .. (repo root, required for the pyproject.toml COPY) makes COPY frontend/... resolve to shogun/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:

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 — only api/v1 was 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 is gensui/ or the repo root.

Test plan

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gensui/Dockerfile: COPY frontend/... builds the wrong app when using repo-root build context

1 participant