Amend Upstream URL

This commit is contained in:
2025-07-15 18:05:11 +02:00
parent 53fc2ed8fb
commit 202959dd9e
5 changed files with 20 additions and 14 deletions

View File

@@ -1,17 +1,19 @@
#!/bin/sh
set -e
: "${API_BASE_URL:=http://localhost:7070}"
: "${API_BASE_URL:=http://localhost}"
: "${API_PORT:=7070}"
# Create runtime config file in writable location
cat > /runtime-config/config.js <<EOF
window.__APP_CONFIG__ = {
API_BASE_URL: "${API_BASE_URL}"
API_BASE_URL: "${API_BASE_URL}",
API_PORT: "${API_PORT}"
};
EOF
# Generate nginx config from template (if using)
if [ -f "/etc/nginx/templates/nginx.conf.template" ]; then
envsubst '${API_BASE_URL}' \
envsubst '${API_BASE_URL} ${API_PORT}' \
< /etc/nginx/templates/nginx.conf.template \
> /etc/nginx/nginx.conf
fi