25 lines
409 B
Bash
25 lines
409 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
cat >/usr/share/nginx/html/config.js <<EOF
|
|
window.__LDAP_PORTAL_CONFIG__ = {
|
|
apiBaseUrl: "${API_BASE_URL:-http://localhost:3000}"
|
|
};
|
|
EOF
|
|
|
|
node /app/api/main.js &
|
|
api_pid="$!"
|
|
|
|
nginx -g "daemon off;" &
|
|
nginx_pid="$!"
|
|
|
|
term() {
|
|
kill "$api_pid" "$nginx_pid" 2>/dev/null || true
|
|
wait "$api_pid" "$nginx_pid" 2>/dev/null || true
|
|
}
|
|
|
|
trap term INT TERM
|
|
|
|
wait -n "$api_pid" "$nginx_pid"
|
|
term
|