From 5f2b0281ec88051434c7c5f1819cf3d2a3dc4405 Mon Sep 17 00:00:00 2001 From: Piet de Vries Date: Tue, 29 Jan 2019 09:42:03 +0100 Subject: [PATCH] Added a healthcheck to the postgres service --- docker-compose.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b9c9825..196fc20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '2.1' services: taiga: @@ -7,7 +7,8 @@ services: - 80:80 # - 443:443 # To enable SSL, uncomment this line. See "Enable SSL" below. depends_on: - - postgres + postgres: + condition: service_healthy # To enable taiga-events, uncomment the following lines: # - events @@ -49,7 +50,11 @@ services: volumes: # Postgres data directory. This ensures the database is not lost. - ./pgdata:/var/lib/postgresql/data - + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 10s + timeout: 5s + retries: 5 # To enable taiga-events, uncomment the following lines: # rabbit: