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:
@@ -28,6 +28,7 @@ services:
|
|||||||
# - ./templates:/app/templates
|
# - ./templates:/app/templates
|
||||||
environment:
|
environment:
|
||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
|
- PYTHONIOENCODING=utf-8
|
||||||
- GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json
|
- GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json
|
||||||
- PYTHONPATH=/app
|
- PYTHONPATH=/app
|
||||||
- FLASK_SECRET_KEY=${FLASK_SECRET_KEY:-change_this_to_a_random_string}
|
- FLASK_SECRET_KEY=${FLASK_SECRET_KEY:-change_this_to_a_random_string}
|
||||||
@@ -41,3 +42,9 @@ services:
|
|||||||
- MODEL_WRITER=${MODEL_WRITER:-AUTO}
|
- MODEL_WRITER=${MODEL_WRITER:-AUTO}
|
||||||
- MODEL_ARTIST=${MODEL_ARTIST:-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"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
flask
|
flask
|
||||||
flask-login
|
flask-login
|
||||||
flask-sqlalchemy
|
flask-sqlalchemy
|
||||||
huey
|
huey==2.6.0
|
||||||
werkzeug
|
werkzeug
|
||||||
google-generativeai
|
google-generativeai
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
|||||||
Reference in New Issue
Block a user