From dc1303c7965a7a94d1f96385ca5616c97256ccc0 Mon Sep 17 00:00:00 2001 From: Florian Zirker Date: Thu, 10 Apr 2025 17:05:26 +0200 Subject: [PATCH] Add postgres to Smarthome --- smartHome/docker-compose.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/smartHome/docker-compose.yaml b/smartHome/docker-compose.yaml index 3f9d183..4a27a1b 100644 --- a/smartHome/docker-compose.yaml +++ b/smartHome/docker-compose.yaml @@ -46,6 +46,26 @@ services: labels: - "docker.group=smartHome" + db: + image: postgres:${POSTGRES_VERSION} + restart: unless-stopped + networks: + - smarthome + volumes: + - ${VOLUMES_PATH}/smartHome/postgres:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + healthcheck: + test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] + start_period: 20s + interval: 30s + retries: 5 + timeout: 5s + labels: + - "docker.group=smartHome" + networks: web: