mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-05 16:02:48 +00:00
17 lines
574 B
Bash
17 lines
574 B
Bash
#!/bin/sh
|
|
# Render the runtime config from container env so a single built image serves
|
|
# any deployment. Runs before nginx starts (nginx /docker-entrypoint.d hook).
|
|
set -eu
|
|
|
|
cat > /usr/share/nginx/html/config.js <<EOF
|
|
window.__WARMBLY_ENV__ = {
|
|
API_URL: "${WARMBLY_API_URL:-}",
|
|
APP_URL: "${WARMBLY_APP_URL:-}",
|
|
TURNSTILE_KEY: "${WARMBLY_TURNSTILE_KEY:-}"
|
|
};
|
|
EOF
|
|
|
|
# The redirect truncates in place and keeps whatever mode the built file had, so
|
|
# a restrictive umask or checkout leaves nginx serving 403 for the whole config.
|
|
chmod 644 /usr/share/nginx/html/config.js
|