From 6efba473a00c90c2c47a9530b0791b68223b0de5 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 9 Apr 2026 09:01:18 -0500 Subject: [PATCH] fix: use exec form CMD so uvicorn receives SIGTERM as PID 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shell form CMD makes /bin/sh PID 1 — SIGTERM from docker stop goes to the shell, not uvicorn, causing SIGKILL after the stop timeout instead of graceful shutdown. Using CMD ["sh", "-c", "exec uvicorn ..."] lets the shell expand $WEB_WORKERS then exec-replaces itself with uvicorn, restoring correct signal delivery. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 600538d..1e0ccb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ # Start uvicorn ENV WEB_WORKERS=2 -CMD uvicorn app.main:app --host 0.0.0.0 --port 80 --workers $WEB_WORKERS \ No newline at end of file +CMD ["sh", "-c", "exec uvicorn app.main:app --host 0.0.0.0 --port 80 --workers $WEB_WORKERS"] \ No newline at end of file