From 632aaff608dc5786a7b1b7b6dbd7204b92251544 Mon Sep 17 00:00:00 2001 From: Swapnil Popat Date: Thu, 11 Dec 2025 19:53:06 +0530 Subject: [PATCH] fix: Add PYTHONUNBUFFERED=1 to Dockerfile for proper logging in containerized deployments When Python runs in Docker containers without PYTHONUNBUFFERED=1, stdout and stderr output is buffered. If the application crashes before the buffer is flushed, critical log output is lost, making debugging and error reporting difficult. This change ensures that Python output is unbuffered so that all logs are captured immediately, regardless of whether the application crashes or exits normally. Fixes issue #19844 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index ad393338d8..425551ac51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,7 @@ ARG GID ## Basis ## ENV ENV=prod \ + PYTHONUNBUFFERED=1 \ PORT=8080 \ # pass build args to the build USE_OLLAMA_DOCKER=${USE_OLLAMA} \