docker
This commit is contained in:
15
docker/single-container.nginx.conf
Normal file
15
docker/single-container.nginx.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
server {
|
||||
listen 8080;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location = /config.js {
|
||||
add_header Cache-Control "no-store";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
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