Fix MLflow localhost references to use Docker service name

Replace hardcoded localhost:5000 with mlflow:5000 in pipeline.yaml
and main.py health check fallback so containers can reach MLflow
over Docker's internal network.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marko Djordjevic 2026-02-21 09:34:16 +01:00
parent f3425557ce
commit 187243bfdb
2 changed files with 2 additions and 2 deletions

View file

@ -536,7 +536,7 @@ async def health_check(response: Response):
# Check MLflow connection via HTTP GET to its health endpoint
mlflow_status = "unhealthy"
try:
mlflow_tracking_uri = os.getenv("MLFLOW_TRACKING_URI", "http://localhost:5000")
mlflow_tracking_uri = os.getenv("MLFLOW_TRACKING_URI", "http://mlflow:5000")
mlflow_health_url = f"{mlflow_tracking_uri.rstrip('/')}/health"
resp = http_requests.get(mlflow_health_url, timeout=3)
if resp.status_code == 200:

View file

@ -127,7 +127,7 @@ stages:
# MLflow settings
mlflow:
tracking_uri: "http://localhost:5000"
tracking_uri: "http://mlflow:5000"
experiment_name: "candlestick_patterns"
log_artifacts: true
register_model: false # Set to true to register in model registry