Compare commits

...

2 Commits

Author SHA1 Message Date
dahoud
0078301ccc Fix: Autoriser .env.production dans git pour le build Docker
Ajoute !.env.production au .gitignore pour permettre au fichier d'être versionné.
Cela permet au build Docker de copier .env.production et de le charger avec ENV NODE_ENV production.

Fixes the issue where NEXT_PUBLIC_API_URL was not set correctly in production builds.
2025-10-24 08:15:29 +00:00
dahoud
2cf0378270 Fix: Add NODE_ENV=production during Next.js build to load .env.production
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.
2025-10-24 08:04:55 +00:00
2 changed files with 16 additions and 8 deletions

23
.gitignore vendored
View File

@@ -29,14 +29,21 @@ yarn-error.log*
# Local env files
.env
.env*.local
.env.local
.env.development
.env.development.local
.env.test
.env.test.local
.env.production
.env.production.local
.env.*
!.env.example
!.env.production
env.local
env.development
env.development.local
env.test
env.test.local
env.production
env.production.local
# Secrets and sensitive files
*.secret
*secret*
keycloak-secret.txt
# Vercel
.vercel

View File

@@ -20,6 +20,7 @@ RUN npm ci
COPY . .
# Build Next.js application
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN npm run build