Fix: Add .env.production with correct API_URL including /btpxpress path

The frontend now correctly points to https://api.lions.dev/btpxpress
instead of just https://api.lions.dev, which fixes the communication
issue between frontend and backend.

This file is needed at build-time because Next.js bakes NEXT_PUBLIC_*
variables into the bundle during the build process.

Fixes:
- Frontend can now call backend API endpoints correctly
- Resolves 404 errors when making API requests
- Works with Ingress rewrite-target configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
dahoud
2025-10-20 10:36:32 +00:00
parent 0e21771b7c
commit ba82f5b168

28
.env.production Normal file
View File

@@ -0,0 +1,28 @@
# Production environment configuration for BTP Xpress Frontend
# This file is used during the Docker build process for production deployments
# API Backend - Points to the backend via Ingress at api.lions.dev/btpxpress
NEXT_PUBLIC_API_URL=https://api.lions.dev/btpxpress
# Keycloak Configuration
NEXT_PUBLIC_KEYCLOAK_URL=https://security.lions.dev
NEXT_PUBLIC_KEYCLOAK_REALM=btpxpress
NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=btpxpress-frontend
# Application
NEXT_PUBLIC_APP_NAME=BTP Xpress
NEXT_PUBLIC_APP_VERSION=1.0.0
NEXT_PUBLIC_APP_DESCRIPTION=Plateforme de gestion BTP
NEXT_PUBLIC_APP_ENV=production
# Theme
NEXT_PUBLIC_DEFAULT_THEME=blue
NEXT_PUBLIC_DEFAULT_THEME_MODE=light
# Security
NEXT_PUBLIC_SESSION_TIMEOUT=1800
NEXT_PUBLIC_SECURITY_STRICT_MODE=true
NEXT_PUBLIC_ENABLE_CLIENT_VALIDATION=true
# Debug - disabled in production
NEXT_PUBLIC_DEBUG=false