From 5072b4e506ff4b170cc02296ee3484a9d55d3c0a Mon Sep 17 00:00:00 2001 From: Simon Milvert Date: Tue, 27 Oct 2026 05:28:24 +0100 Subject: [PATCH] Add shared x-logging template to compose files Every service now uses `logging: *default-logging` (json-file, 10m x 3). Previously ~35 services had no limit and grew unbounded. Also fix the broken restart line in x-common-keys-monitoring. Co-Authored-By: Claude Opus 5.5 --- docker-compose.per.yml | 24 ++++------- docker-compose.service.yml | 48 ++++++--------------- docker-compose.web.yml | 38 ++++++----------- docker-compose.yml | 87 ++++++++++++++++---------------------- 4 files changed, 72 insertions(+), 125 deletions(-) diff --git a/docker-compose.per.yml b/docker-compose.per.yml index 27dc508..582e1ff 100644 --- a/docker-compose.per.yml +++ b/docker-compose.per.yml @@ -1,13 +1,15 @@ version: '3' +x-logging: &default-logging + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + services: wordpress: container_name: peek - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging depends_on: - db_peek image: wordpress:php8.4-apache @@ -53,11 +55,7 @@ services: db_peek: container_name: db_peek image: mysql:8.4 - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging volumes: - ${DIR_LOCAL}/peekskog/db84:/var/lib/mysql restart: always @@ -74,11 +72,7 @@ services: - db_peek image: phpmyadmin/phpmyadmin container_name: phpmyadmin_peek - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always networks: - backend diff --git a/docker-compose.service.yml b/docker-compose.service.yml index 9c4e10e..75ed220 100644 --- a/docker-compose.service.yml +++ b/docker-compose.service.yml @@ -1,14 +1,16 @@ version: '3' +x-logging: &default-logging + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + services: zigbee_home_2: container_name: zigbee_home_2 - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging networks: - backend ports: @@ -36,11 +38,7 @@ services: zigbee2mqtt: container_name: zigbee2mqtt - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend image: koenkk/zigbee2mqtt:2.13 @@ -69,11 +67,7 @@ services: influx: image: influxdb:2.7 container_name: influxdb - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend restart: always @@ -112,11 +106,7 @@ services: image: telegraf:1.25 restart: always container_name: telegraf - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend ports: @@ -141,11 +131,7 @@ services: gitea: image: gitea/gitea:1.21 container_name: gitea - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend restart: always @@ -176,11 +162,7 @@ services: # image: eclipse-mosquitto:1.6.13 image: eclipse-mosquitto:2.0.18 container_name: mqtt - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend restart: always @@ -214,10 +196,7 @@ services: mqtt_landet: image: eclipse-mosquitto:2.0.9 container_name: mqtt_landet - logging: - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend restart: always @@ -238,6 +217,7 @@ services: diun: image: ghcr.io/crazy-max/diun:4 container_name: diun + logging: *default-logging networks: - backend volumes: diff --git a/docker-compose.web.yml b/docker-compose.web.yml index d5029e2..d3d3aab 100644 --- a/docker-compose.web.yml +++ b/docker-compose.web.yml @@ -1,14 +1,16 @@ version: '3' +x-logging: &default-logging + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + services: milvert: container_name: milvert image: nginx:latest - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always networks: - backend @@ -30,6 +32,7 @@ services: whoami: # A container that exposes an API to show its IP address container_name: whoami + logging: *default-logging image: containous/whoami networks: - backend @@ -49,11 +52,7 @@ services: # A container that exposes an API to show its IP address container_name: ttrss image: wangqiru/ttrss:latest - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: unless-stopped networks: - backend @@ -77,11 +76,7 @@ services: image: diak:1.0 build: ./diabets_app/client container_name: diak - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging networks: - backend ports: @@ -101,11 +96,7 @@ services: syncthing: image: linuxserver/syncthing container_name: syncthing - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging environment: - PUID=1000 - PGID=1000 @@ -134,11 +125,7 @@ services: torrent: image: linuxserver/rutorrent container_name: torrent - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging environment: - PUID=1000 - PGID=1000 @@ -161,6 +148,7 @@ services: librespeed: image: ghcr.io/linuxserver/librespeed container_name: librespeed + logging: *default-logging environment: - PUID=${UUID} - PGID=${PGID} diff --git a/docker-compose.yml b/docker-compose.yml index 28ea000..50f2363 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,13 +51,21 @@ x-common-keys-monitoring: &common-keys-monitoring networks: - backend security_opt: - - no-new-privileges:true restart: always + - no-new-privileges:true + restart: always + +x-logging: &default-logging + driver: "json-file" + options: + max-size: "10m" + max-file: "3" services: dockge: image: louislam/dockge:1 container_name: dockge + logging: *default-logging restart: unless-stopped environment: - DOCKGE_STACKS_DIR=/home/simon/repo/Docker/stacks @@ -85,11 +93,7 @@ services: #image: traefik:v2.11 image: traefik:v3.7 container_name: "traefik" - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: unless-stopped networks: - backend @@ -129,6 +133,7 @@ services: authelia: image: authelia/authelia:4 container_name: authelia + logging: *default-logging restart: always volumes: - ./authelia:/config @@ -177,6 +182,7 @@ services: ddns-updater: image: qmcgaw/ddns-updater:2.7 container_name: ddns-updater + logging: *default-logging restart: always networks: - backend @@ -219,11 +225,7 @@ services: db: image: mariadb:10.5.6 container_name: mariaDB - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always networks: - backend @@ -245,11 +247,7 @@ services: web_db: image: adminer container_name: adminer - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always networks: - backend @@ -273,11 +271,7 @@ services: postgres: image: postgres:15 container_name: postgres - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always networks: - backend @@ -297,11 +291,7 @@ services: pgadmin: container_name: pgadmin_container image: dpage/pgadmin4 - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging environment: PUID: ${UID} PGID: ${GID} @@ -328,11 +318,7 @@ services: redis: image: redis:7.0-alpine container_name: redis - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always networks: - backend @@ -350,6 +336,7 @@ services: ha: container_name: ha + logging: *default-logging image: homeassistant/home-assistant:2026.10 restart: always privileged: true @@ -386,6 +373,7 @@ services: hassconf: container_name: hassconf + logging: *default-logging image: causticlab/hass-configurator-docker:0.5.2 restart: unless-stopped networks: @@ -406,6 +394,7 @@ services: appdaemon: container_name: appdaemon + logging: *default-logging image: acockburn/appdaemon:4.5.13 restart: unless-stopped depends_on: @@ -430,6 +419,7 @@ services: zwave-js: container_name: zwave-js + logging: *default-logging image: zwavejs/zwave-js-ui:9 restart: always tty: true @@ -454,6 +444,7 @@ services: esphome: container_name: esphome + logging: *default-logging image: ghcr.io/esphome/esphome:2025.7.3 volumes: - ./esphome:/config @@ -477,6 +468,7 @@ services: matter-server: image: ghcr.io/matter-js/python-matter-server:stable container_name: matter-server + logging: *default-logging restart: unless-stopped network_mode: host #networks: @@ -497,6 +489,7 @@ services: command: - evcc container_name: evcc + logging: *default-logging image: evcc/evcc:0.317.2 ports: - 7070:7070/tcp @@ -519,11 +512,7 @@ services: grafana: image: grafana/grafana:10.3.1 container_name: grafana - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging restart: always networks: - backend @@ -545,11 +534,7 @@ services: image: nodered/node-red:4.1 # command: ["node-red", "--safe"] container_name: "node-red" - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging networks: - backend environment: @@ -576,11 +561,7 @@ services: nextcloud: container_name: nextcloud image: nextcloud:28 - logging: - driver: "json-file" - options: - max-size: "5m" - max-file: "3" + logging: *default-logging restart: always ports: - "8009:80" @@ -630,11 +611,7 @@ services: gitea: image: gitea/gitea:1.21 container_name: gitea - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "5" + logging: *default-logging networks: - backend restart: always @@ -665,6 +642,7 @@ services: uptime_kuma: image: louislam/uptime-kuma container_name: uptime_kuma + logging: *default-logging networks: - backend environment: @@ -694,6 +672,7 @@ services: jelu: image: wabayang/jelu container_name: jelu + logging: *default-logging environment: - PUID=${UUID} - PGID=${PGID} @@ -724,6 +703,7 @@ services: vwsfriend: image: tillsteinbach/vwsfriend:0.24.7 container_name: vwfriend + logging: *default-logging ports: - ${VWSFRIEND_PORT-4000}:${VWSFRIEND_PORT-4000} networks: @@ -766,6 +746,7 @@ services: vwgrafana: image: tillsteinbach/vwsfriend-grafana:0.24.5 container_name: vwgrafana + logging: *default-logging ports: - ${GF_SERVER_HTTP_PORT-3001}:${GF_SERVER_HTTP_PORT-3000} networks: @@ -824,6 +805,7 @@ services: carconnectivity: image: "tillsteinbach/carconnectivity-mqtt:latest" container_name: carconnectivity + logging: *default-logging volumes: - ./carconnectivity/carconnectivity.json:/carconnectivity.json - ./carconnectivity/entrypoint.sh:/root/entrypoint.sh:ro @@ -849,6 +831,7 @@ services: carconnectivity-grafana: image: "ghcr.io/tillsteinbach/carconnectivity-grafana:edge" container_name: carconnect-grafana + logging: *default-logging volumes: - ${DIR_LOCAL}/carconnect-grafana:/var/lib/grafana # - ${DIR_LOCAL}/carconnectivity/sqlite.db:/carconnectivity.db:ro @@ -884,6 +867,7 @@ services: couchdb: image: couchdb:3.5 container_name: couchdb + logging: *default-logging restart: unless-stopped entrypoint: ["/bin/sh", "/couchdb-entrypoint.sh"] networks: @@ -914,6 +898,7 @@ services: build: https://github.com/vrtmrz/livesync-bridge.git#fc0e028d33b3a12ddee1322951375e05107edc55 image: livesync-bridge:fc0e028 container_name: livesync-bridge + logging: *default-logging restart: unless-stopped user: "${UID}:${GID}" depends_on: