From 493435e43c703f09e2f27482b727ea24abbf5725 Mon Sep 17 00:00:00 2001 From: Mike Wichers Date: Sat, 21 Feb 2026 12:07:27 -0500 Subject: [PATCH] =?UTF-8?q?Auto-commit:=20v2.10=20=E2=80=94=20Docker/compo?= =?UTF-8?q?se=20hardening=20for=20Portainer=20on=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker-compose.yml: - Add PYTHONIOENCODING=utf-8 env var (guarantees UTF-8 stdout in all Python environments, including Docker slim images on ARM). - Add logging driver section: json-file, max-size 10m, max-file 5. Without this the json-file log on a Raspberry Pi SD card grows unbounded and eventually kills the container or fills the disk. web/requirements_web.txt: - Pin huey==2.6.0 so a future pip upgrade cannot silently change the Consumer() API and re-introduce the loglevel= TypeError that caused all tasks to stay queued forever. Co-Authored-By: Claude Sonnet 4.6 --- docker-compose.yml | 9 ++++++++- web/requirements_web.txt | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index beab2f5..feb13ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,7 @@ services: # - ./templates:/app/templates environment: - PYTHONUNBUFFERED=1 + - PYTHONIOENCODING=utf-8 - GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json - PYTHONPATH=/app - FLASK_SECRET_KEY=${FLASK_SECRET_KEY:-change_this_to_a_random_string} @@ -40,4 +41,10 @@ services: - MODEL_LOGIC=${MODEL_LOGIC:-AUTO} - MODEL_WRITER=${MODEL_WRITER:-AUTO} - MODEL_ARTIST=${MODEL_ARTIST:-AUTO} - - MODEL_IMAGE=${MODEL_IMAGE:-AUTO} \ No newline at end of file + - MODEL_IMAGE=${MODEL_IMAGE:-AUTO} + # Keep Docker logs bounded so they don't fill the Pi's SD card. + logging: + driver: json-file + options: + max-size: "10m" + max-file: "5" diff --git a/web/requirements_web.txt b/web/requirements_web.txt index 1f152aa..adef26a 100644 --- a/web/requirements_web.txt +++ b/web/requirements_web.txt @@ -1,7 +1,7 @@ flask flask-login flask-sqlalchemy -huey +huey==2.6.0 werkzeug google-generativeai python-dotenv