From e56e485fcd57b0f4b62336be5dda9dfe3e533693 Mon Sep 17 00:00:00 2001 From: dahoud Date: Sat, 25 Oct 2025 16:46:02 +0000 Subject: [PATCH] Fix: Define NEXT_PUBLIC variables explicitly in Dockerfile for build time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added explicit ENV declarations for all NEXT_PUBLIC_* variables in the builder stage before npm run build. This ensures Next.js correctly bakes these values into the JavaScript bundle, regardless of lionsctl's automatic manifest generation. Variables defined: - NEXT_PUBLIC_API_URL=https://api.lions.dev/btpxpress - NEXT_PUBLIC_KEYCLOAK_URL=https://security.lions.dev - NEXT_PUBLIC_KEYCLOAK_REALM=btpxpress - NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=btpxpress-frontend - NEXT_PUBLIC_APP_ENV=production This fixes the issue where the frontend was using https://api.lions.dev instead of https://api.lions.dev/btpxpress for API calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 88570c5..579db20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,14 @@ COPY . . # Build Next.js application ENV NODE_ENV production ENV NEXT_TELEMETRY_DISABLED 1 + +# Define NEXT_PUBLIC variables explicitly for build time +ENV NEXT_PUBLIC_API_URL=https://api.lions.dev/btpxpress +ENV NEXT_PUBLIC_KEYCLOAK_URL=https://security.lions.dev +ENV NEXT_PUBLIC_KEYCLOAK_REALM=btpxpress +ENV NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=btpxpress-frontend +ENV NEXT_PUBLIC_APP_ENV=production + RUN npm run build ## Stage 3: Production image