#!/bin/sh
# Generate runtime configuration file

echo "Generating runtime configuration..."
echo "API URL: ${NEXT_PUBLIC_API_URL:-http://localhost:8001}"

cat > /app/public/config.js << EOF
// Runtime configuration generated at container startup
window.__RUNTIME_CONFIG__ = {
  API_URL: '${NEXT_PUBLIC_API_URL:-http://localhost:8001}'
};
EOF

echo "Configuration generated successfully!"
cat /app/public/config.js
