Frontend: - Add runtime configuration service for deployment-time API URL injection - Create docker-entrypoint.sh to generate config.json from environment variables - Update ApiService, ApprovalService, and DocumentViewer to use RuntimeConfigService - Add APP_INITIALIZER to load runtime config before app starts Backend: - Fix init-blockchain.js to properly quote mnemonic phrases in .env file - Improve docker-entrypoint.sh with health checks and better error handling Docker: - Add API_BASE_URL environment variable to frontend container - Update docker-compose.yml with clear documentation for remote deployment - Reorganize .env.example with clear categories (REQUIRED FOR REMOTE, PRODUCTION, AUTO-GENERATED) Workflow fixes: - Fix DepartmentApproval interface to match backend schema - Fix stage transformation for 0-indexed stageOrder - Fix workflow list to show correct stage count from definition.stages Cleanup: - Move development artifacts to .trash directory - Remove root-level package.json (was only for utility scripts) - Add .trash/ to .gitignore
35 lines
1007 B
Bash
35 lines
1007 B
Bash
#!/bin/sh
|
|
# ==============================================================================
|
|
# Goa GEL Frontend - Docker Entrypoint
|
|
# ==============================================================================
|
|
# Injects runtime configuration from environment variables
|
|
# ==============================================================================
|
|
|
|
set -e
|
|
|
|
# Configuration directory in nginx html root
|
|
CONFIG_DIR="/usr/share/nginx/html/assets"
|
|
CONFIG_FILE="${CONFIG_DIR}/config.json"
|
|
|
|
# Default values (same as build-time defaults)
|
|
API_BASE_URL="${API_BASE_URL:-http://localhost:3001/api/v1}"
|
|
|
|
echo "=== Goa GEL Frontend Runtime Configuration ==="
|
|
echo "API_BASE_URL: ${API_BASE_URL}"
|
|
echo "=============================================="
|
|
|
|
# Ensure config directory exists
|
|
mkdir -p "${CONFIG_DIR}"
|
|
|
|
# Generate runtime configuration JSON
|
|
cat > "${CONFIG_FILE}" << EOF
|
|
{
|
|
"apiBaseUrl": "${API_BASE_URL}"
|
|
}
|
|
EOF
|
|
|
|
echo "Runtime config written to ${CONFIG_FILE}"
|
|
|
|
# Execute the main command (nginx)
|
|
exec "$@"
|