Add scheduler backend image workflow
All checks were successful
Build scheduler-backend image / build-and-push (push) Successful in 3m36s
All checks were successful
Build scheduler-backend image / build-and-push (push) Successful in 3m36s
This commit is contained in:
31
docker-entrypoint.sh
Normal file
31
docker-entrypoint.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
/app/api &
|
||||
api_pid="$!"
|
||||
|
||||
/app/worker &
|
||||
worker_pid="$!"
|
||||
|
||||
term() {
|
||||
kill "$api_pid" "$worker_pid" 2>/dev/null || true
|
||||
wait "$api_pid" "$worker_pid" 2>/dev/null || true
|
||||
}
|
||||
|
||||
trap term INT TERM
|
||||
|
||||
while :; do
|
||||
if ! kill -0 "$api_pid" 2>/dev/null; then
|
||||
wait "$api_pid" || true
|
||||
term
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! kill -0 "$worker_pid" 2>/dev/null; then
|
||||
wait "$worker_pid" || true
|
||||
term
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
done
|
||||
Reference in New Issue
Block a user