Initial
This commit is contained in:
24
docker/start.sh
Normal file
24
docker/start.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
node /app/dist/main.js &
|
||||
api_pid="$!"
|
||||
nginx_pid=""
|
||||
|
||||
shutdown() {
|
||||
kill "$api_pid" 2>/dev/null || true
|
||||
kill "$nginx_pid" 2>/dev/null || true
|
||||
}
|
||||
|
||||
trap shutdown TERM INT
|
||||
|
||||
nginx -g "daemon off;" &
|
||||
nginx_pid="$!"
|
||||
|
||||
while kill -0 "$api_pid" 2>/dev/null && kill -0 "$nginx_pid" 2>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
shutdown
|
||||
wait "$api_pid" 2>/dev/null || true
|
||||
wait "$nginx_pid" 2>/dev/null || true
|
||||
Reference in New Issue
Block a user