From 7fdb82a9e9ea2f70d4e4b72ba274853709430ac5 Mon Sep 17 00:00:00 2001 From: KM Koushik Date: Mon, 8 Dec 2025 09:19:37 +1100 Subject: [PATCH] Fix version display in side navigation (#306) Co-authored-by: Claude --- docker/Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b158234..7b6c0f5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,13 +30,20 @@ RUN apk add --no-cache libc6-compat RUN apk update WORKDIR /app - # First install the dependencies (as they change less often) COPY .gitignore .gitignore COPY --from=builder /app/out/json/ . COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile +# Build arguments for version information +# Placed after install to preserve dependency cache when version changes +ARG APP_VERSION=unknown +ARG GIT_SHA=unknown + +# Set version as environment variables for Next.js build +ENV NEXT_PUBLIC_APP_VERSION=$APP_VERSION +ENV NEXT_PUBLIC_GIT_SHA=$GIT_SHA # Build the project COPY --from=builder /app/out/full/ . @@ -46,14 +53,6 @@ RUN pnpm turbo run build --filter=web... FROM base AS runner WORKDIR /app -# Build arguments for version information -ARG APP_VERSION=unknown -ARG GIT_SHA=unknown - -# Set version as environment variables -ENV NEXT_PUBLIC_APP_VERSION=$APP_VERSION -ENV NEXT_PUBLIC_GIT_SHA=$GIT_SHA - COPY --from=installer /app/apps/web/next.config.js . COPY --from=installer /app/apps/web/package.json . COPY --from=installer /app/pnpm-lock.yaml .