From 3a854d77ac5f101967993492da9465fa07bb7ad1 Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Tue, 15 Jul 2025 00:08:29 +0200 Subject: [PATCH] fix: use IMMICH_HOST env var in ML healthcheck (#19844) Fixes #19843 --- machine-learning/scripts/healthcheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/machine-learning/scripts/healthcheck.py b/machine-learning/scripts/healthcheck.py index 8a4ec897f0..82c6cad790 100644 --- a/machine-learning/scripts/healthcheck.py +++ b/machine-learning/scripts/healthcheck.py @@ -4,9 +4,12 @@ import sys import requests port = os.getenv("IMMICH_PORT", 3003) +host = os.getenv("IMMICH_HOST", "0.0.0.0") + +host = "localhost" if host == "0.0.0.0" else host try: - response = requests.get(f"http://localhost:{port}/ping", timeout=2) + response = requests.get(f"http://{host}:{port}/ping", timeout=2) if response.status_code == 200: sys.exit(0) sys.exit(1)