From 17f0e22962c88b209229ee96aebfaab65769e1f6 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 30 Aug 2020 14:50:03 +0100 Subject: [PATCH] Migrate grafana to postgres --- ansible/roles/grafana/files/docker-compose.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ansible/roles/grafana/files/docker-compose.yml b/ansible/roles/grafana/files/docker-compose.yml index 51e0abf..6b94178 100644 --- a/ansible/roles/grafana/files/docker-compose.yml +++ b/ansible/roles/grafana/files/docker-compose.yml @@ -5,9 +5,12 @@ services: image: grafana/grafana:latest environment: - TZ=Europe/London + - GF_DATABASE_URL=postgres://grafana:grafana@db/grafana volumes: - /mnt/tank/app-data/grafana:/var/lib/grafana restart: unless-stopped + depends_on: + - db networks: - default - grafana @@ -16,6 +19,15 @@ services: - traefik.http.routers.grafana.rule=Host(`grafana.jakehoward.tech`) - traefik.http.routers.grafana.tls.certresolver=le + db: + image: postgres:12-alpine + restart: unless-stopped + volumes: + - /mnt/tank/dbs/postgres/grafana:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=grafana + - POSTGRES_USER=grafana + networks: grafana: external: true