Gunicorn: log to stdout/stderr + preload for crash visibility
All checks were successful
Build and Deploy PunktFri / build-and-deploy (push) Successful in 47s

- --access-logfile - : access logs to stdout (visible in Nomad)
- --error-logfile -  : error logs to stderr (visible in Nomad)
- --log-level info   : show startup and worker events
- --preload          : load app before forking workers — crashes
                       surface immediately instead of silently dying
This commit is contained in:
Henrik Jess Nielsen
2026-04-28 21:46:57 +02:00
parent 585a8c8ada
commit 5fc893755f

View File

@@ -26,4 +26,4 @@ RUN mkdir -p /app/instance
EXPOSE 5000 EXPOSE 5000
CMD ["sh", "-c", "gunicorn --bind ${HOST}:${PORT} --workers 2 --timeout 60 app:app"] CMD ["sh", "-c", "gunicorn --bind ${HOST}:${PORT} --workers 2 --timeout 60 --access-logfile - --error-logfile - --log-level info --preload app:app"]