Mxli's personal page

🥤MLFlow to go

A Portable, Dockerized MLflow Tracking Server (with MinIO + Postgres)

Setting up a reliable, portable MLflow tracking server that actually works outside of toy examples is harder than it should be. The official docs are helpful, but small misconfigurations — especially around Docker networking and artifact storage — can silently break things.

This repo is my cleaned-up, touch-and-go leaning version of a fully dockerized MLflow tracking stack, based on:

📲 Repo: https://github.com/mxli417/Portable_MLFlow

Big credit goes to Erik Dao, whose original setup provided a solid baseline — this version fixes several subtle but important and interesting issues.

✨ What This Setup Provides

This is ideal for:

🏗️ Architecture Overview

MLflow Server
     │
     ├── PostgreSQL (experiments, runs, metadata)
     │
     └── MinIO (S3-compatible artifact store)

All services run in the same Docker network and communicate via service names (not localhost).

🏃‍➡️ Quick Start

1. Prepare environment variables

cp .env-template .env

Set:

2. Adjust if needed

For production or corporate usage:

3. Start everything

docker-compose up -d --build

Once running:

🧠 My key learnings & fixes

1. ❌ MLflow + MinIO + localhost = broken

The official MLflow docs reference localhost in examples. This does not work in Docker, because containers resolve localhost to themselves.

✔️ Fix: Use the Docker service name (minio) instead.


2. ❌ MinIO bucket creation race condition

Erik Dao’s setup almost works — except:

✔️ Fix: Add a startup delay or wait loop before creating the bucket. This is a very common real-world Docker pitfall.

3. ❌ Mixed credential handling

The original docs:

✔️ Fix: Everything is now controlled via .env for:

This avoids accidental credential leaks and simplifies deployment.

4. 🧭 MLflow Registry Changes (Important)

MLflow is deprecating:

Moving toward:

This setup is compatible with the new direction and avoids legacy assumptions.

RFC:

“Deprecating model registry stages in favor of model version tags and aliases.”

📜 Summary

My updated version provides an easy-to-use MLFlow setup that can be quite handy if you’re working in ML Engineering, work on GenAI or other usecases where logging is helpful and necessary, regardless if you’re a hobbyist or professional. Of course, my implementation also leaves for improvement, so feel free to work from my small blueprint and enhance the template regarding:

Feel free to use this as a starting point and adapt it to your needs.

📚 References