docker
This commit is contained in:
24
docker/start-single-container.sh
Normal file
24
docker/start-single-container.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user