Problem: Frontend was trying to contact http://localhost:8080 instead of
https://api.lions.dev/btpxpress because NEXT_PUBLIC_API_URL wasn't correctly
baked into the Next.js bundle during build.
Solution:
- Added ARG declarations with correct default values for all NEXT_PUBLIC_* variables
- Convert ARG to ENV before running npm run build
- This ensures Next.js bakes the correct values into the bundle
- ARG allows override at docker build time if needed
- Fixed ENV format to use = instead of space (removes Docker warnings)
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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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 <noreply@anthropic.com>
Next.js only loads .env.production when NODE_ENV=production is set during build time.
Previously, NODE_ENV was only set in the runner stage, causing the builder stage to
ignore .env.production and use default values.
This fixes NEXT_PUBLIC_API_URL to correctly point to https://api.lions.dev/btpxpress
instead of just https://api.lions.dev.