From 1d65e7dfbda1dd2c175c4d45032ed6880cea85d9 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Sun, 3 Nov 2024 01:54:24 +0100 Subject: [PATCH] feat: add backend healthcheck --- templates/compose/erpnext.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/compose/erpnext.yaml b/templates/compose/erpnext.yaml index 8303ff8a2..246b37117 100644 --- a/templates/compose/erpnext.yaml +++ b/templates/compose/erpnext.yaml @@ -8,9 +8,14 @@ services: backend: image: frappe/erpnext:v15.38.1 + healthcheck: + test: | + curl --fail -H "Host: $$FRAPPE_SITE_NAME_HEADER" http://localhost:8000/api/method/ping | jq '.message == "pong"' | grep true || exit 1 deploy: restart_policy: condition: on-failure + environment: + FRAPPE_SITE_NAME_HEADER: my-erpnext volumes: - sites:/home/frappe/frappe-bench/sites - logs:/home/frappe/frappe-bench/logs