Skip to content

High performance self-hosted photo and video management solution.

fix: use IMMICH_HOST env var in ML healthcheck (#19844)

bo0tzz3a854d77ac5f
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)