Auto-commit: v2.10 — Docker/compose hardening for Portainer on Pi

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 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 12:07:27 -05:00
parent 0d4b9b761b
commit 493435e43c
2 changed files with 9 additions and 2 deletions

View File

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