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
This commit is contained in:
Swapnil Popat 2025-12-11 19:53:06 +05:30 committed by GitHub
parent 6f1486ffd0
commit 632aaff608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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} \