mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-13 09:36:05 +00:00
fix(docker): include web/translation in frontend and final stages
The Vite SPA reads locale JSON via a glob that resolves to <repo>/web/translation/*.json, but the frontend build stage only copied frontend/, so the production bundle shipped with no messages and the Docker panel rendered untranslated keys. Copy the directory into the frontend stage at the path the glob expects, and into the final image so the Go disk fallback in locale.loadTranslationsFromDisk also has somewhere to read from.
This commit is contained in:
parent
f68a14a3ca
commit
3505430e57
1 changed files with 2 additions and 7 deletions
|
|
@ -1,19 +1,13 @@
|
|||
# ========================================================
|
||||
# Stage: Frontend (Vite)
|
||||
# ========================================================
|
||||
# web/dist/ is .gitignored and embedded into the Go binary via
|
||||
# //go:embed all:dist in web/web.go, so the SPA bundle MUST be built
|
||||
# before the Go compile step. We build it in its own stage so the
|
||||
# Go builder image doesn't need Node installed.
|
||||
FROM node:22-alpine AS frontend
|
||||
WORKDIR /src/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
COPY web/translation /src/web/translation
|
||||
RUN npm run build
|
||||
# Vite outDir is set to ../web/dist (see frontend/vite.config.js), so
|
||||
# the bundle lands at /src/web/dist — that's what we copy into the
|
||||
# next stage.
|
||||
|
||||
# ========================================================
|
||||
# Stage: Builder
|
||||
|
|
@ -54,6 +48,7 @@ RUN apk add --no-cache --update \
|
|||
COPY --from=builder /app/build/ /app/
|
||||
COPY --from=builder /app/DockerEntrypoint.sh /app/
|
||||
COPY --from=builder /app/x-ui.sh /usr/bin/x-ui
|
||||
COPY --from=builder /app/web/translation /app/web/translation
|
||||
|
||||
|
||||
# Configure fail2ban
|
||||
|
|
|
|||
Loading…
Reference in a new issue