From e6b847344c997a720adc1d94eaf20a6925197d94 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 20 May 2023 19:54:01 +0200 Subject: [PATCH] [TRAEFIK] Add auto-backup --- roles/traefik/templates/docker-compose.yml.j2 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/roles/traefik/templates/docker-compose.yml.j2 b/roles/traefik/templates/docker-compose.yml.j2 index 7a128d6..dfa3212 100644 --- a/roles/traefik/templates/docker-compose.yml.j2 +++ b/roles/traefik/templates/docker-compose.yml.j2 @@ -115,6 +115,33 @@ services: volumes: - ./config/dynamic_conf.yaml:/usr/local/apache2/htdocs/dynamic_conf.yaml + # BACKUP + backup_prometheus: + image: offen/docker-volume-backup:latest + restart: always + environment: + BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}" + BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-prometheus.tar.gz" + BACKUP_LATEST_SYMLINK: prometheus.latest.tar.gz + BACKUP_EXCLUDE_REGEXP: "\\.log$$" + BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}" + volumes: + - prometheus:/backup:ro + - {{ server.backup.folder }}/traefik:/archive + + backup_grafana: + image: offen/docker-volume-backup:latest + restart: always + environment: + BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}" + BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-grafana.tar.gz" + BACKUP_LATEST_SYMLINK: grafana.latest.tar.gz + BACKUP_EXCLUDE_REGEXP: "\\.log$$" + BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}" + volumes: + - grafana:/backup:ro + - {{ server.backup.folder }}/traefik:/archive + networks: providers: internal: