-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
143 lines (132 loc) · 3.66 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
132
133
134
135
136
137
138
139
140
141
142
143
version: '3.3'
services:
batch_prediction:
build: ./prediction_service_batch/
image: prediction_service_batch
container_name: prediction_service_batch
volumes:
- ./data:/home/ubuntu/mlops_zoomcamp_homework/data
networks:
- frontend
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
- TRACKING_SERVER_HOST=${TRACKING_SERVER_HOST}
- MLFLOW_BUCKET_NAME=${MLFLOW_BUCKET_NAME}
depends_on:
- web
- nginx
prediction_service:
build: ./prediction_service_stream/
image: prediction_service_stream
container_name: prediction_service_stream
depends_on:
- evidently_service
- mongo
- web
env_file:
- .env
environment:
TRACKING_SERVER_HOST: "mlflow_nginx"
EVIDENTLY_SERVICE_ADDRESS: "http://evidently_service:8085"
MONGODB_ADDRESS: "mongodb://mongo:27017/"
ports:
- "9696:9696"
networks:
- backend
- frontend
web:
restart: always
build: ./mlflow
image: mlflow_server
container_name: mlflow_server
expose:
- "5000"
networks:
- frontend
- backend
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
command: mlflow server --backend-store-uri postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DATABASE} --default-artifact-root s3://${MLFLOW_BUCKET_NAME} --host 0.0.0.0 -p 5000
nginx:
restart: always
build: ./nginx
image: mlflow_nginx
container_name: mlflow_nginx
ports:
- "80:80"
networks:
- frontend
depends_on:
- web
mongo:
image: mongo
container_name: mongo
ports:
- 27017:27017
volumes:
- mongo_data:/data/db
networks:
- backend
- frontend
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./05-monitoring/evidently_service/config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
ports:
- "9091:9090"
networks:
- backend
restart: always
grafana:
image: grafana/grafana
container_name: grafana
user: "472"
depends_on:
- prometheus
ports:
- "3000:3000"
volumes:
- ./05-monitoring/evidently_service/config/grafana_datasources.yaml:/etc/grafana/provisioning/datasources/datasource.yaml:ro
- ./05-monitoring/evidently_service/config/grafana_dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:ro
- ./05-monitoring/evidently_service/dashboards:/opt/grafana/dashboards
- grafana_data:/var/lib/grafana
networks:
- backend
- frontend
restart: always
evidently_service:
build:
context: ./05-monitoring/evidently_service
dockerfile: Dockerfile
image: evidently_service
container_name: evidently_service
depends_on:
- grafana
volumes:
- ./05-monitoring/evidently_service/datasets:/app/datasets
- ./05-monitoring/evidently_service/config.yaml:/app/config.yaml
ports:
- "8085:8085"
networks:
- backend
- frontend
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
grafana_data: {}
prometheus_data: {}
mongo_data: {}
# based on https://towardsdatascience.com/deploy-mlflow-with-docker-compose-8059f16b6039
# but used postgresql db instead no aws as done in mlops zoomcamp course