-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (114 loc) · 2.76 KB
/
docker-compose.yml
File metadata and controls
121 lines (114 loc) · 2.76 KB
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
version: '3.8'
services:
# Diamond Price Predictor API
api:
build:
context: .
dockerfile: Dockerfile.flask
container_name: diamond-predictor-api
ports:
- "5000:5000"
environment:
- FLASK_ENV=production
- FLASK_HOST=0.0.0.0
- FLASK_PORT=5000
- PYTHONPATH=/app/src
volumes:
- ./artifacts:/app/artifacts
- ./logs:/app/logs
- ./models:/app/models
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/v1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- diamond-network
# MLflow Tracking Server
mlflow:
image: python:3.9-slim
container_name: diamond-mlflow
ports:
- "5001:5000"
volumes:
- ./mlruns:/mlflow/mlruns
- ./artifacts:/mlflow/artifacts
working_dir: /mlflow
command: >
sh -c "
pip install mlflow>=2.0.0 &&
mlflow server
--backend-store-uri sqlite:///mlruns/mlflow.db
--default-artifact-root /mlflow/artifacts
--host 0.0.0.0
--port 5000
"
restart: unless-stopped
networks:
- diamond-network
# Streamlit Dashboard
dashboard:
build:
context: .
dockerfile: Dockerfile.streamlit
container_name: diamond-dashboard
ports:
- "8501:8501"
environment:
- API_URL=http://api:5000
depends_on:
api:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- diamond-network
# Prometheus Monitoring (Optional)
prometheus:
image: prom/prometheus:latest
container_name: diamond-prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
restart: unless-stopped
networks:
- diamond-network
profiles:
- monitoring
# Grafana Dashboard (Optional)
grafana:
image: grafana/grafana:latest
container_name: diamond-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-storage:/var/lib/grafana
depends_on:
- prometheus
restart: unless-stopped
networks:
- diamond-network
profiles:
- monitoring
networks:
diamond-network:
driver: bridge
volumes:
grafana-storage:
driver: local