From 51ab9b65a672041f02101cd3b15325fb7b64c296 Mon Sep 17 00:00:00 2001 From: AdrienLSH Date: Sat, 25 Nov 2023 00:26:54 +0100 Subject: [PATCH] fix: django starting b4 db was ready --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b3cda3d..ca24f14 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,9 @@ services: restart: always env_file: .env depends_on: - - db + db: + condition: service_healthy + restart: true db: image: postgres @@ -23,6 +25,11 @@ services: container_name: db restart: always env_file: .env + healthcheck: + test: "pg_isready -U $POSTGRES_USER" + interval: 5s + timeout: 5s + retries: 5 volumes: db: