From 1cbbfc7c66de6f12c190a24506f7d8225c66abca Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Wed, 24 Jan 2024 17:57:35 +0000 Subject: [PATCH] fix: use exec the uvicorn process to handle Docker's SIGTERM correctly Replace the shell with the uvicorn process, so it becomes PID 1 and receives the signals directly --- backend/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/start.sh b/backend/start.sh index e6d09364..09a791fc 100755 --- a/backend/start.sh +++ b/backend/start.sh @@ -4,4 +4,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd "$SCRIPT_DIR" || exit PORT="${PORT:-8080}" -uvicorn main:app --host 0.0.0.0 --port "$PORT" --forwarded-allow-ips '*' +exec uvicorn main:app --host 0.0.0.0 --port "$PORT" --forwarded-allow-ips '*'