From 9cbf8c2135d2d9533ef6cc65426ff09920f439ae Mon Sep 17 00:00:00 2001 From: chriscrosstalk <49691103+chriscrosstalk@users.noreply.github.com> Date: Mon, 20 Apr 2026 20:12:36 -0700 Subject: [PATCH] build: write version.json from VERSION build-arg (#754) The Dockerfile copied root package.json to /app/version.json, which SystemService.getAppVersion() reads on every render of the app version in the UI. semantic-release only reliably commits that bump back on the main branch; on the rc branch it does not, so v1.31.1-rc.1 and v1.31.1-rc.2 both shipped with a version.json still reading 1.31.0. Result: a user who upgrades to rc.2 sees "1.31.0" in the UI and a persistent "update to v1.31.1-rc.2 available" prompt. The build workflow already passes VERSION as a build-arg (used today only for the OCI image label). Generating version.json from that arg at build time makes the image tag the single source of truth and eliminates the drift, regardless of what the committed-back package.json says. Dev builds (no VERSION override) write "dev", which matches the existing NODE_ENV=development short-circuit in getAppVersion(). Co-authored-by: Claude Opus 4.7 (1M context) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c91f9ac..03acaa9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,8 +43,10 @@ ENV NODE_ENV=production WORKDIR /app COPY --from=production-deps /app/node_modules /app/node_modules COPY --from=build /app/build /app -# Copy root package.json for version info -COPY package.json /app/version.json +# Generate version.json from the VERSION build-arg so the image tag is the +# single source of truth (previously copied root package.json, which drifted +# from the tag when semantic-release did not commit the bump back). +RUN echo "{\"version\":\"${VERSION}\"}" > /app/version.json # Copy docs and README for access within the container COPY admin/docs /app/docs