diff --git a/infra/docker-compose.yml b/infra/docker-compose.yml index d81ce6f..9f60585 100644 --- a/infra/docker-compose.yml +++ b/infra/docker-compose.yml @@ -73,6 +73,11 @@ services: - hiy-pg-data:/var/lib/postgresql/data # SQL files here run once on first init (ignored if data volume already exists). - ./postgres-init:/docker-entrypoint-initdb.d:ro + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] + interval: 5s + timeout: 5s + retries: 10 networks: - hiy-net @@ -96,7 +101,8 @@ services: volumes: - forgejo-data:/data depends_on: - - postgres + postgres: + condition: service_healthy networks: - hiy-net