From d5d60f163c26599751ca6b9324169dc288c10c3d Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Fri, 11 Sep 2026 13:59:53 +1000 Subject: [PATCH] fix the restart policy --- docker-compose.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6b9a2df..68007e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,13 @@ services: timescaledb: image: timescale/timescaledb:latest-pg16 + restart: unless-stopped + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres -d micrometeo"] + interval: 5s + timeout: 3s + retries: 12 + start_period: 20s environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres @@ -17,7 +24,8 @@ services: context: . dockerfile: Dockerfile depends_on: - - timescaledb + timescaledb: + condition: service_healthy restart: unless-stopped ports: - "8080:8080" @@ -29,7 +37,8 @@ services: context: . dockerfile: Dockerfile.train depends_on: - - timescaledb + timescaledb: + condition: service_healthy restart: unless-stopped environment: DATABASE_URL: "postgres://postgres:postgres@timescaledb:5432/micrometeo?sslmode=disable" @@ -64,7 +73,8 @@ services: context: . dockerfile: Dockerfile.train depends_on: - - timescaledb + timescaledb: + condition: service_healthy restart: unless-stopped profiles: ["shadow"] environment: