diff --git a/docker/frontend/entrypoint.sh b/docker/frontend/entrypoint.sh index a81272969..283e20a82 100644 --- a/docker/frontend/entrypoint.sh +++ b/docker/frontend/entrypoint.sh @@ -6,5 +6,13 @@ VITE_API_BASE_URL=${VITE_API_BASE_URL:-"http://backend:8080"} # Replace the placeholder in nginx.conf with the actual backend URL sed -i "s|\${VITE_API_BASE_URL}|${VITE_API_BASE_URL}|g" /etc/nginx/nginx.conf +# Inject runtime configuration into config.js +cat > /usr/share/nginx/html/config.js << EOF +// Runtime configuration - injected at container startup +window.runtimeConfig = { + apiBaseUrl: '${VITE_API_BASE_URL}' +}; +EOF + # Start nginx exec nginx -g "daemon off;" \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 0fc165c66..964c2d4b8 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -12,11 +12,12 @@ -