From 244ea79d0a1e00c280785966c0e690804250553c Mon Sep 17 00:00:00 2001 From: conache Date: Wed, 29 May 2024 13:10:08 +0300 Subject: [PATCH] Add inference service healthcheck to ensure the updater service properly starts up --- docker-compose.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ea8eb16..c4777a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,15 +13,27 @@ services: aliases: - inference ipv4_address: 172.22.0.4 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/inference/ETH"] + interval: 10s + timeout: 5s + retries: 12 updater: container_name: updater-basic-eth-pred build: . environment: - INFERENCE_API_ADDRESS=http://inference:8000 - command: python -u /app/update_app.py + command: > + sh -c " + while true; do + python -u /app/update_app.py; + sleep 10; + done + " depends_on: - - inference + inference: + condition: service_healthy networks: eth-model-local: aliases: