From 7b03ceab98838081a4ced9ee0fa8e4677a889039 Mon Sep 17 00:00:00 2001 From: McKenna Jones Date: Sat, 7 Jan 2023 11:49:11 -0700 Subject: [PATCH] Gracefully stop docker container when it receives SIGTERM (#368) * add die-on-term option to uwsgi * exec uwsgi in bootstrap.sh --- bootstrap.sh | 2 +- uwsgi.ini | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index fb184c0..e843e2e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -22,4 +22,4 @@ if [ "$LD_DISABLE_BACKGROUND_TASKS" != "True" ]; then fi # Start uwsgi server -uwsgi --http :$LD_SERVER_PORT uwsgi.ini +exec uwsgi --http :$LD_SERVER_PORT uwsgi.ini diff --git a/uwsgi.ini b/uwsgi.ini index ba0d3cd..a15dcb6 100644 --- a/uwsgi.ini +++ b/uwsgi.ini @@ -11,6 +11,7 @@ stats = 127.0.0.1:9191 uid = www-data gid = www-data buffer-size = 8192 +die-on-term = true if-env = LD_CONTEXT_PATH static-map = /%(_)static=static