-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
131 lines (121 loc) · 3.3 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This docker-compose file is only for quick launch mlflow.
# Do not use in the production environment.
version: '3.6'
# rotating logs so they do not overflow
x-logging:
logging: &default-logging
driver: "local"
options:
max-size: "10m"
max-file: "3"
services:
db:
image: postgres
restart: always
volumes:
- "./data/postgres-data:/var/lib/postgresql/data"
expose:
- 5432
networks:
- internal-net
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
mlflow:
restart: always
build: ./mlflow
image: mlflow:latest
expose:
- 5000
networks:
- internal-net
volumes:
- "./data/mlflow-data:/mlflow"
environment:
- AWS_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- AWS_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD}
- MLFLOW_S3_ENDPOINT_URL=http://minio:9000
command:
- sh
- -c
- mlflow server
--backend-store-uri postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
--artifacts-destination s3://${BUCKET_NAME}
--host 0.0.0.0
minio:
image: minio/minio
restart: always
expose:
- 9000
- 9001
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
- MINIO_PROMETHEUS_URL=${MINIO_PROMETHEUS_URL:-http://prometheus:9090}
- MINIO_PROMETHEUS_AUTH_TYPE=${MINIO_PROMETHEUS_AUTH_TYPE:-public}
- MLFLOW_TRACKING_INSECURE_TLS=true
networks:
- internal-net
volumes:
- "./data/minio-data:${MINIO_VOLUMES}"
healthcheck:
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
interval: 1s
timeout: 10s
retries: 5
command: server ${MINIO_VOLUMES} --console-address ":9001"
# Create a bucket named "bucket" if it doesn't exist
# Inspire by https://mlflow.org/docs/latest/tracking/tutorials/remote-server.html#create-compose-yaml
minio-create-bucket:
image: minio/mc
depends_on:
minio:
condition: service_healthy
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
- BUCKET_NAME=${BUCKET_NAME}
entrypoint: >
bash -c "
mc alias set minio http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} &&
if ! mc ls minio | grep --quiet bucket; then
mc mb minio/${BUCKET_NAME}
else
echo '${BUCKET_NAME} already exists'
fi
"
prometheus:
image: quay.io/prometheus/prometheus:v2.37.1
restart: always
logging: *default-logging
networks:
- internal-net
expose:
- 9090
volumes:
- "./prometheus/minio/prometheus.yml:/etc/prometheus/prometheus.yml"
- "./data/prometheus-data:/prometheus"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
nginx:
image: nginx
restart: always
ports:
- "9000:9000"
- "9001:9001"
- "5000:5000"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/ssl:/etc/nginx/ssl
- ./nginx/log:/var/log/nginx
networks:
- mlflow-net
- internal-net
depends_on:
- minio
networks:
internal-net:
mlflow-net:
external: true