From adc70b7643ffbff82029cd25e815426a9f07e2ea Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 9 Feb 2023 04:43:53 +0100 Subject: [PATCH] Add logging limits to all services (mongo, nightscout and traefik) (#7884) Parameters defined in x-logging extension field with options: max-size: '10m' max-file: '5' --- docker-compose.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b757f89d370..6e0e5dd1ab5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,18 @@ version: '3' +x-logging: + &default-logging + options: + max-size: '10m' + max-file: '5' + driver: json-file + services: mongo: image: mongo:4.4 volumes: - ${NS_MONGO_DATA_DIR:-./mongo-data}:/data/db:cached + logging: *default-logging nightscout: image: nightscout/cgm-remote-monitor:latest @@ -19,6 +27,7 @@ services: - 'traefik.http.routers.nightscout.rule=Host(`localhost`)' - 'traefik.http.routers.nightscout.entrypoints=websecure' - 'traefik.http.routers.nightscout.tls.certresolver=le' + logging: *default-logging environment: ### Variables for the container NODE_ENV: production @@ -74,3 +83,4 @@ services: volumes: - './letsencrypt:/letsencrypt' - '/var/run/docker.sock:/var/run/docker.sock:ro' + logging: *default-logging