From 3d76c48bbfc8e43ce64e04847956fa6b49bc721e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 30 Aug 2020 16:58:27 +0100 Subject: [PATCH] Use postgres on homeassistant --- ansible/roles/home-assistant/files/configuration.yml | 3 +++ .../roles/home-assistant/files/docker-compose.yml | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ansible/roles/home-assistant/files/configuration.yml b/ansible/roles/home-assistant/files/configuration.yml index 74b9afd..81e1297 100644 --- a/ansible/roles/home-assistant/files/configuration.yml +++ b/ansible/roles/home-assistant/files/configuration.yml @@ -21,3 +21,6 @@ influxdb: light: - platform: flux_led automatic_add: true + +recorder: + db_url: postgres://home-assistant:home-assistant@127.0.0.1:45432/home-assistant diff --git a/ansible/roles/home-assistant/files/docker-compose.yml b/ansible/roles/home-assistant/files/docker-compose.yml index 142e6d1..410215b 100644 --- a/ansible/roles/home-assistant/files/docker-compose.yml +++ b/ansible/roles/home-assistant/files/docker-compose.yml @@ -11,6 +11,7 @@ services: restart: unless-stopped depends_on: - influxdb + - db labels: - traefik.enable=true - traefik.http.routers.homeassistant.rule=Host(`homeassistant.jakehoward.tech`) @@ -40,6 +41,17 @@ services: volumes: - ./esphome:/config + db: + image: postgres:12-alpine + restart: unless-stopped + ports: + - 127.0.0.1:45432:5432 + volumes: + - /mnt/tank/dbs/postgres/home-assistant:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=home-assistant + - POSTGRES_USER=home-assistant + networks: grafana: external: true