From 7cd816e94fd2bb97ad1a4ed8fdd5afe00b96fe96 Mon Sep 17 00:00:00 2001 From: mj52951 Date: Tue, 17 Dec 2024 10:16:17 +0100 Subject: [PATCH] Changes to docker compose --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index fb8de9c..61ad5e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,13 +38,20 @@ services: ports: - "23798:${DB_PORT}" env_file: ./envs/.env.init + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME} && psql -U ${DB_USERNAME} -d ${DB_NAME} -c 'SELECT 1'"] + interval: 10s + retries: 5 + start_period: 30s + timeout: 10s indexer-init: build: context: . dockerfile: ./Dockerfile restart: on-failure depends_on: - - db + db: + condition: service_healthy env_file: ./envs/.env.init indexer_evm1: build: