15 lines
340 B
Bash
15 lines
340 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
backend_base_url=${BACKEND_BASE_URL:-/api}
|
|
runtime_config=$(jq -cn --arg backend_base_url "$backend_base_url" \
|
|
'{backendBaseUrl: $backend_base_url}')
|
|
printf 'window.__THOTHII_CONFIG__ = %s;\n' "$runtime_config" \
|
|
> /usr/share/nginx/html/config.js
|
|
|
|
if [ "$#" -gt 0 ]; then
|
|
exec "$@"
|
|
fi
|
|
|
|
exec nginx -g 'daemon off;'
|