From 61f2471d488058d46c582e620f41c2ebec74b65b Mon Sep 17 00:00:00 2001 From: Marko Djordjevic Date: Sat, 21 Feb 2026 09:57:24 +0100 Subject: [PATCH] Replace MLflow inline pip hack with proper Dockerfile Add services/mlflow/Dockerfile that extends the official image with psycopg2-binary, and point docker-compose to build from it. Co-Authored-By: Claude Sonnet 4.6 --- docker-compose.yml | 17 +++++++---------- services/mlflow/Dockerfile | 3 +++ 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 services/mlflow/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 29dcce9..e23722f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,20 +63,17 @@ services: start_period: 40s mlflow: - image: ghcr.io/mlflow/mlflow:v2.10.0 + build: ./services/mlflow ports: - "127.0.0.1:5000:5000" volumes: - mlflow-data:/mlflow - entrypoint: ["/bin/sh", "-c"] - command: - - | - pip install --quiet psycopg2-binary && - mlflow server - --backend-store-uri "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}" - --default-artifact-root /mlflow/artifacts - --host 0.0.0.0 - --port 5000 + command: > + mlflow server + --backend-store-uri "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}" + --default-artifact-root /mlflow/artifacts + --host 0.0.0.0 + --port 5000 restart: unless-stopped postgres: diff --git a/services/mlflow/Dockerfile b/services/mlflow/Dockerfile new file mode 100644 index 0000000..25b9090 --- /dev/null +++ b/services/mlflow/Dockerfile @@ -0,0 +1,3 @@ +FROM ghcr.io/mlflow/mlflow:v2.10.0 + +RUN pip install --no-cache-dir psycopg2-binary