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 <noreply@anthropic.com>
This commit is contained in:
Simon 2026-10-27 05:28:24 +01:00
parent 08393fe565
commit 5072b4e506
4 changed files with 72 additions and 125 deletions

View File

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

View File

@ -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:

View File

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

View File

@ -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: