From 4412700e12153fcd8fa7fd08ec778ba091745301 Mon Sep 17 00:00:00 2001 From: Eric Gullickson <16152721+ericgullickson@users.noreply.github.com> Date: Sun, 8 Feb 2026 21:27:33 -0600 Subject: [PATCH] fix: use valid Redis log levels and add log level comments to all containers Redis only supports debug|verbose|notice|warning -- not info or error. The command was using ${LOG_LEVEL:-info} which resolved to INFO in production (from workflow env), causing Redis to crash loop. Hardcode the correct Redis-native levels (debug for dev, warning for prod) and add available log level comments above every container's log setting. Co-Authored-By: Claude Opus 4.6 --- docker-compose.prod.yml | 11 ++++++++--- docker-compose.staging.yml | 3 ++- docker-compose.yml | 12 ++++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 40c6ca5..2006cbf 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -12,9 +12,11 @@ services: # Traefik - Production log level and dashboard auth mvp-traefik: environment: + # Traefik log levels: TRACE | DEBUG | INFO | WARN | ERROR LOG_LEVEL: error command: - --configFile=/etc/traefik/traefik.yml + # Traefik log levels: TRACE | DEBUG | INFO | WARN | ERROR - --log.level=ERROR labels: - "traefik.enable=true" @@ -30,6 +32,7 @@ services: NODE_ENV: production CONFIG_PATH: /app/config/production.yml SECRETS_DIR: /run/secrets + # Pino log levels: trace | debug | info | warn | error | fatal LOG_LEVEL: error DATABASE_HOST: mvp-postgres REDIS_HOST: mvp-redis @@ -41,6 +44,7 @@ services: # OCR - Production log level + engine config mvp-ocr: environment: + # Python log levels: DEBUG | INFO | WARNING | ERROR | CRITICAL LOG_LEVEL: error REDIS_HOST: mvp-redis REDIS_PORT: 6379 @@ -59,13 +63,14 @@ services: POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password POSTGRES_INITDB_ARGS: --encoding=UTF8 LOG_LEVEL: error + # PostgreSQL log statements: none | ddl | mod | all POSTGRES_LOG_STATEMENT: none + # Minimum query duration to log: -1 (disabled) | 0 (all) | N (ms threshold) POSTGRES_LOG_MIN_DURATION_STATEMENT: -1 PGDATA: /var/lib/postgresql/data/pgdata # Redis - Remove dev ports, production log level mvp-redis: ports: [] - command: redis-server --appendonly yes --loglevel ${LOG_LEVEL:-info} - environment: - LOG_LEVEL: error + # Redis log levels: debug | verbose | notice | warning + command: redis-server --appendonly yes --loglevel warning diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index 253b78b..cfebd25 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -64,6 +64,7 @@ services: image: ${OCR_IMAGE:-git.motovaultpro.com/egullickson/ocr:latest} container_name: mvp-ocr-staging environment: + # Python log levels: DEBUG | INFO | WARNING | ERROR | CRITICAL LOG_LEVEL: debug REDIS_HOST: mvp-redis REDIS_PORT: 6379 @@ -79,7 +80,7 @@ services: mvp-postgres: container_name: mvp-postgres-staging volumes: - - mvp_postgres_staging_data:/var/lib/postgresql/data + - mvp_postgres_staging_data:/var/lib/postgresql/data/pgdata - ./secrets/app/postgres-password.txt:/run/secrets/postgres-password:ro # ======================================== diff --git a/docker-compose.yml b/docker-compose.yml index 5e9a247..32012c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: command: - --configFile=/etc/traefik/traefik.yml environment: + # Traefik log levels: TRACE | DEBUG | INFO | WARN | ERROR LOG_LEVEL: debug CLOUDFLARE_DNS_API_TOKEN_FILE: /run/secrets/cloudflare-dns-token ports: @@ -113,6 +114,7 @@ services: NODE_ENV: production CONFIG_PATH: /app/config/production.yml SECRETS_DIR: /run/secrets + # Pino log levels: trace | debug | info | warn | error | fatal LOG_LEVEL: debug # Service references DATABASE_HOST: mvp-postgres @@ -189,6 +191,7 @@ services: container_name: mvp-ocr restart: unless-stopped environment: + # Python log levels: DEBUG | INFO | WARNING | ERROR | CRITICAL LOG_LEVEL: debug REDIS_HOST: mvp-redis REDIS_PORT: 6379 @@ -231,11 +234,13 @@ services: POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password POSTGRES_INITDB_ARGS: --encoding=UTF8 LOG_LEVEL: debug + # PostgreSQL log statements: none | ddl | mod | all POSTGRES_LOG_STATEMENT: all + # Minimum query duration to log: -1 (disabled) | 0 (all) | N (ms threshold) POSTGRES_LOG_MIN_DURATION_STATEMENT: 0 PGDATA: /var/lib/postgresql/data/pgdata volumes: - - mvp_postgres_data:/var/lib/postgresql/data + - mvp_postgres_data:/var/lib/postgresql/data/pgdata # Secrets (K8s Secrets equivalent) - ./secrets/app/postgres-password.txt:/run/secrets/postgres-password:ro networks: @@ -259,9 +264,8 @@ services: image: ${REGISTRY_MIRRORS:-git.motovaultpro.com/egullickson/mirrors}/redis:8.4-alpine container_name: mvp-redis restart: unless-stopped - command: redis-server --appendonly yes --loglevel ${LOG_LEVEL:-info} - environment: - LOG_LEVEL: debug + # Redis log levels: debug | verbose | notice | warning + command: redis-server --appendonly yes --loglevel debug volumes: - mvp_redis_data:/data networks: