#!/bin/sh # Write the SPA's runtime operator config at container start. # # The nginx base image runs every /docker-entrypoint.d/*.sh before launching # nginx, so this overwrites the build-time public/config.js stub with the value # of $PUBLIC_API_BASE_URL. That lets one prebuilt image target any backend # origin without rebuilding. Resolution + precedence live in src/config/env.ts. set -eu : "${PUBLIC_API_BASE_URL:=/api/v1}" ROOT="${NGINX_HTML_ROOT:-/usr/share/nginx/html}" printf 'window.__APP_CONFIG__={"apiBaseUrl":"%s"};\n' "$PUBLIC_API_BASE_URL" \ >"$ROOT/config.js" echo "runtime-config: wrote apiBaseUrl=$PUBLIC_API_BASE_URL to $ROOT/config.js"