/ examples / mlflow_artifacts / docker-compose.yml
docker-compose.yml
 1  version: "3"
 2  services:
 3    minio:
 4      image: minio/minio
 5      expose:
 6        - "9000"
 7      ports:
 8        - "9000:9000"
 9        # MinIO Console is available at http://localhost:9001
10        - "9001:9001"
11      environment:
12        MINIO_ROOT_USER: "user"
13        MINIO_ROOT_PASSWORD: "password"
14      healthcheck:
15        test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
16        interval: 1s
17        timeout: 10s
18        retries: 5
19      # Note there is no bucket by default
20      command: server /data --console-address ":9001"
21  
22    minio-create-bucket:
23      image: minio/mc
24      depends_on:
25        minio:
26          condition: service_healthy
27      entrypoint: >
28        bash -c "
29        mc alias set minio http://minio:9000 user password &&
30        if ! mc ls minio/bucket; then
31          mc mb minio/bucket
32        else
33          echo 'bucket already exists'
34        fi
35        "
36  
37    artifacts-server:
38      build:
39        context: .
40        dockerfile: "${DOCKERFILE:-Dockerfile}"
41      depends_on:
42        - minio-create-bucket
43      expose:
44        - "5500"
45      ports:
46        - "5500:5500"
47      environment:
48        MLFLOW_S3_ENDPOINT_URL: http://minio:9000
49        AWS_ACCESS_KEY_ID: "user"
50        AWS_SECRET_ACCESS_KEY: "password"
51        MLFLOW_SERVER_ENABLE_JOB_EXECUTION: "false"
52        MLFLOW_SERVER_DISABLE_SECURITY_MIDDLEWARE: "true"
53      command: >
54        mlflow server
55        --host 0.0.0.0
56        --port 5500
57        --artifacts-destination s3://bucket
58        --gunicorn-opts "--log-level debug"
59        --artifacts-only
60  
61    postgres:
62      image: postgres
63      restart: always
64      environment:
65        POSTGRES_DB: db
66        POSTGRES_USER: user
67        POSTGRES_PASSWORD: password
68  
69    tracking-server:
70      build:
71        context: .
72        dockerfile: "${DOCKERFILE:-Dockerfile}"
73      depends_on:
74        - postgres
75        - artifacts-server
76      expose:
77        - "5000"
78      ports:
79        # MLflow UI is available at http://localhost:5000
80        - "5000:5000"
81      environment:
82        MLFLOW_SERVER_ENABLE_JOB_EXECUTION: "false"
83        MLFLOW_SERVER_DISABLE_SECURITY_MIDDLEWARE: "true"
84      command: >
85        mlflow server
86        --host 0.0.0.0
87        --port 5000
88        --backend-store-uri postgresql://user:password@postgres:5432/db
89        --default-artifact-root http://artifacts-server:5500/api/2.0/mlflow-artifacts/artifacts/experiments
90        --gunicorn-opts "--log-level debug"
91  
92    client:
93      build:
94        context: .
95        dockerfile: "${DOCKERFILE:-Dockerfile}"
96      depends_on:
97        - tracking-server
98      environment:
99        MLFLOW_TRACKING_URI: http://tracking-server:5000