From 8d996db8e3d9211e0c782dadded3477b7c43ee20 Mon Sep 17 00:00:00 2001 From: BhasherBEL Date: Sat, 28 Oct 2023 13:19:34 +0200 Subject: [PATCH] Restart policy, grafana weekly report & depends_on --- bxl-shp/apps/docker-compose.baikal.yaml | 2 +- bxl-shp/apps/docker-compose.invoice.yaml | 1 + bxl-shp/apps/docker-compose.registry.yaml | 6 ++- bxl-shp/apps/docker-compose.smarthome.yaml | 13 ++++-- bxl-shp/system/docker-compose.monitoring.yaml | 46 ++++++++++++++++++- bxl-shp/system/docker-compose.storage.yaml | 2 +- bxl-shp/system/docker-compose.watchtower.yaml | 1 + 7 files changed, 63 insertions(+), 8 deletions(-) diff --git a/bxl-shp/apps/docker-compose.baikal.yaml b/bxl-shp/apps/docker-compose.baikal.yaml index 395cd84..80c083a 100644 --- a/bxl-shp/apps/docker-compose.baikal.yaml +++ b/bxl-shp/apps/docker-compose.baikal.yaml @@ -2,7 +2,7 @@ services: baikal: container_name: baikal image: ckulka/baikal:nginx - restart: on-failure + restart: unless-stopped environment: - TZ=Europe/Paris volumes: diff --git a/bxl-shp/apps/docker-compose.invoice.yaml b/bxl-shp/apps/docker-compose.invoice.yaml index 21bf4db..afd1299 100644 --- a/bxl-shp/apps/docker-compose.invoice.yaml +++ b/bxl-shp/apps/docker-compose.invoice.yaml @@ -2,6 +2,7 @@ services: invoiceplane: container_name: invoiceplane image: mhzawadi/invoiceplane:latest + restart: unless-stopped volumes: - $DATA/invoiceplane/uploads:/var/www/html/uploads - $DATA/invoiceplane/ipconfig.php:/var/www/html/ipconfig.php diff --git a/bxl-shp/apps/docker-compose.registry.yaml b/bxl-shp/apps/docker-compose.registry.yaml index 74a2f77..9be684e 100644 --- a/bxl-shp/apps/docker-compose.registry.yaml +++ b/bxl-shp/apps/docker-compose.registry.yaml @@ -2,7 +2,7 @@ services: registry-ui: container_name: registry-ui image: joxit/docker-registry-ui:main - restart: always + restart: on-failure:5 labels: - "traefik.enable=true" - "traefik.http.routers.registryui.rule=Host(`registry.bhasher.com`)" @@ -26,10 +26,12 @@ services: networks: - registry - external + depends_on: + - registry registry: image: registry:2.8.2 - restart: always + restart: on-failure:5 container_name: registry ports: - 5000:5000 diff --git a/bxl-shp/apps/docker-compose.smarthome.yaml b/bxl-shp/apps/docker-compose.smarthome.yaml index 00b8d8f..05bebce 100644 --- a/bxl-shp/apps/docker-compose.smarthome.yaml +++ b/bxl-shp/apps/docker-compose.smarthome.yaml @@ -8,7 +8,7 @@ services: networks: - smarthome - external - restart: on-failure + restart: unless-stopped labels: - "traefik.enable=true" - "traefik.http.routers.hass.rule=Host(`hass.bhasher.com`)" @@ -16,6 +16,9 @@ services: - "traefik.http.services.hass.loadbalancer.server.port=8123" - "traefik.http.routers.hass.tls=true" - "traefik.http.routers.hass.tls.certresolver=http" + depends_on: + - authelia + - traefik mosquitto: container_name: mosquitto @@ -31,7 +34,7 @@ services: networks: - smarthome - external - restart: on-failure + restart: unless-stopped zigbee2mqtt: container_name: zigbee2mqtt @@ -45,10 +48,12 @@ services: - /dev/ttyACM0:/dev/ttyACM0 networks: - smarthome + depends_on: + - mosquitto nodered: container_name: nodered - restart: on-failure + restart: on-failure:5 image: nodered/node-red:latest volumes: - $DATA/nodered:/data @@ -64,6 +69,8 @@ services: - "traefik.http.routers.nodered.tls=true" - "traefik.http.routers.nodered.tls.certresolver=http" - "traefik.http.routers.nodered.middlewares=authelia@docker" + depends_on: + - hass networks: diff --git a/bxl-shp/system/docker-compose.monitoring.yaml b/bxl-shp/system/docker-compose.monitoring.yaml index b40e16d..906ad63 100644 --- a/bxl-shp/system/docker-compose.monitoring.yaml +++ b/bxl-shp/system/docker-compose.monitoring.yaml @@ -61,6 +61,8 @@ services: - GF_AUTH_GENERIC_OAUTH_GROUPS_PATH=groups - GF_AUTH_GENERIC_OAUTH_ALLOWED_GROUPS=admin - GF_AUTH_OAUTH_ALLOW_INSECURE_EMAIL_LOOKUP=true + - GF_RENDERING_SERVER_URL=http://grafana-renderer:8081/render + - GF_RENDERING_CALLBACK_URL=http://grafana:3000/ volumes: - $DATA/monitoring/grafana:/var/lib/grafana - /etc/localtime:/etc/localtime:ro @@ -131,7 +133,49 @@ services: - /etc/localtime:/etc/localtime:ro networks: - monitoring - + depends_on: + - prometheus + + grafana-renderer: + container_name: grafana-renderer + image: grafana/grafana-image-renderer:latest + restart: unless-stopped + networks: + - monitoring + depends_on: + - grafana + + grafana-reporter: + container_name: grafana-reporter + image: izakmarais/grafana-reporter:latest + restart: unless-stopped + command: "-ip grafana:3000 -cmd_enable=0 -grid-layout=1" + networks: + - monitoring + - external + depends_on: + - grafana + - grafana-renderer + + grafana-sendreport: + container_name: grafana-sendreport + image: registry.bhasher.com/send-report:latest + restart: unless-stopped + environment: + - PDF_URL=grafana-reporter:8686/api/v5/report/64nrElFmj?apitoken=${GRAFANA_TOKEN}&var-interval=5m&from=now-7d&to=now + - TO_EMAIL=grafana-report.lan@bhasher.com + - SMTP_SERVER=bdubois.io + - SMTP_PORT=465 + - SMTP_USER=${SMTP_USER} + - SMTP_PASSWORD=${SMTP_PASSWORD} + - CRON_SCHEDULE=0 4 * * 0 + networks: + - monitoring + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + depends_on: + - grafana-reporter networks: monitoring: diff --git a/bxl-shp/system/docker-compose.storage.yaml b/bxl-shp/system/docker-compose.storage.yaml index c2e1446..6e7c5b7 100644 --- a/bxl-shp/system/docker-compose.storage.yaml +++ b/bxl-shp/system/docker-compose.storage.yaml @@ -21,7 +21,7 @@ services: mariadb: container_name: mariadb image: mariadb:latest - restart: on-failure + restart: unless-stopped environment: - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT} volumes: diff --git a/bxl-shp/system/docker-compose.watchtower.yaml b/bxl-shp/system/docker-compose.watchtower.yaml index b73b05a..958e25e 100644 --- a/bxl-shp/system/docker-compose.watchtower.yaml +++ b/bxl-shp/system/docker-compose.watchtower.yaml @@ -2,6 +2,7 @@ services: watchtower: container_name: watchtower image: containrrr/watchtower + restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc/localtime:/etc/localtime:ro