소스 검색

feat: add container health check

Christoph Schug 2 년 전
부모
커밋
10ae69e17a
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      docker-compose/postgres/docker-compose.yaml

+ 6 - 0
docker-compose/postgres/docker-compose.yaml

@@ -13,6 +13,12 @@ services:
       - TZ=${TZ:-UTC}
     ports:
       - 5432:5432
+    healthcheck:
+      test: ['CMD-SHELL', 'pg_isready -U "${POSTGRES_USER:-postgres}"']
+      start_period: 30s
+      interval: 10s
+      timeout: 10s
+      retries: 5
     # (Optional) when using custom network, see also
     # https://docs.docker.com/compose/compose-file/compose-file-v3/#networks
     #