From 900c86d1d3263464054b51db669fcca208fffe5c Mon Sep 17 00:00:00 2001 From: michaeltapang13 Date: Tue, 27 Feb 2024 01:26:05 -0700 Subject: [PATCH] added healthcheck to docker-compose.yml --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index dfed9d8..077893e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,4 +41,11 @@ services: stdin_open: true tty: true command: ["/bin/bash"] - + + #This can help Docker automatically handle container failures and restart unhealthy containers. + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s \ No newline at end of file