#!/bin/sh set -e # Generate config.json from environment variables at container startup # This allows runtime configuration without rebuilding the container CONFIG_FILE="/usr/share/nginx/html/config.json" echo "🔧 Generating frontend runtime configuration..." # Use API_URL from environment, or fallback to same origin API_BASE_URL="${API_URL:-}" if [ -z "$API_BASE_URL" ]; then echo "⚠️ API_URL not set, frontend will auto-detect or use same origin" # Create minimal config that triggers auto-detection cat > "$CONFIG_FILE" < "$CONFIG_FILE" <