-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathentrypoint.sh
More file actions
31 lines (24 loc) · 886 Bytes
/
entrypoint.sh
File metadata and controls
31 lines (24 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Entrypoint script for runtime configuration
# Reads TARGET_URL environment variable and configures the application
set -e
# Default TARGET_URL if not provided
TARGET_URL=${TARGET_URL:-localhost}
echo "Configuring application with TARGET_URL: $TARGET_URL"
# Generate runtime configuration file for frontend
cat > /app/public/config.js <<EOF
// Auto-generated runtime configuration
window.APP_CONFIG = {
SETTING_SERVICE_API_URL: 'http://${TARGET_URL}:8080',
SETTING_SERVICE_TIMEOUT: 5000,
};
EOF
echo "Generated runtime config:"
cat /app/public/config.js
# Export environment variables for Vite dev server proxy
export VITE_METRICS_TARGET="http://${TARGET_URL}:8080"
export VITE_CONTAINERS_TARGET="http://localhost:5000"
export VITE_LOG_SERVICE_URL="http://${TARGET_URL}:47097"
# Start the application
echo "Starting Vite dev server..."
exec npm run dev -- --force