Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (149 loc) · 4.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
157 lines (149 loc) · 4.17 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: voiceflow-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-voiceflow}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_DB: ${POSTGRES_DB:-voiceflow}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U voiceflow"]
interval: 10s
timeout: 5s
retries: 5
networks:
- voiceflow-network
# Redis Cache
redis:
image: redis:7.2-alpine
container_name: voiceflow-redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- voiceflow-network
# Python ML Service
ml-service:
build:
context: ./voiceflow-ml
dockerfile: Dockerfile
container_name: voiceflow-ml-service
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=${POSTGRES_USER:-voiceflow}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
- POSTGRES_DB=${POSTGRES_DB:-voiceflow}
- REDIS_HOST=redis
- REDIS_PORT=6379
- RUST_SERVICE_URL=http://inference-engine:3000
- DEBUG=false
- ENV=development
- JWT_SECRET_KEY=${JWT_SECRET_KEY:?JWT_SECRET_KEY is required}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3000,http://localhost:8000,http://localhost:3001}
ports:
- "8000:8000"
volumes:
- ./models:/models
- ./data:/data
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- voiceflow-network
restart: unless-stopped
# Rust Inference Engine
inference-engine:
build:
context: ./voiceflow-inference
dockerfile: Dockerfile
container_name: voiceflow-inference-engine
environment:
- HOST=0.0.0.0
- PORT=3000
- MODELS_DIR=/models
- INFERENCE_THREADS=4
- OPTIMIZATION_LEVEL=Level3
- JWT_SECRET_KEY=${JWT_SECRET_KEY:?JWT_SECRET_KEY is required}
ports:
- "3000:3000"
volumes:
- ./models:/models:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- voiceflow-network
restart: unless-stopped
# Prometheus Metrics
prometheus:
image: prom/prometheus:v2.48.0
container_name: voiceflow-prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "9090:9090"
depends_on:
- ml-service
- inference-engine
networks:
- voiceflow-network
restart: unless-stopped
# Grafana Dashboards
grafana:
image: grafana/grafana:10.2.2
container_name: voiceflow-grafana
environment:
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:?GF_SECURITY_ADMIN_PASSWORD is required}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/var/lib/grafana/dashboards/voiceflow-overview.json
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
- ./grafana/provisioning:/etc/grafana/provisioning:ro
ports:
- "3001:3000"
depends_on:
- prometheus
networks:
- voiceflow-network
restart: unless-stopped
networks:
voiceflow-network:
driver: bridge
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data: