-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
260 lines (247 loc) · 6.96 KB
/
docker-compose.yml
File metadata and controls
260 lines (247 loc) · 6.96 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
services:
# Frontend Service
frontend:
build:
context: .
dockerfile: sentinel_frontend/Dockerfile.prod
container_name: sentinel_frontend
ports:
- "3000:80"
environment:
- REACT_APP_API_URL=http://localhost:8000
- REACT_APP_API_GATEWAY_URL=http://api_gateway:8000
- REACT_APP_WS_URL=ws://localhost:8000/ws
- REACT_APP_ENV=production
depends_on:
- api_gateway
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
restart: unless-stopped
networks:
- sentinel_network
db:
image: pgvector/pgvector:pg16
container_name: sentinel_db
env_file:
- sentinel_backend/.env.docker
environment:
- POSTGRES_USER=sentinel
- POSTGRES_PASSWORD=sentinel_password
- POSTGRES_DB=sentinel_db
ports:
- "5432:5432"
volumes:
- sentinel_postgres_data:/var/lib/postgresql/data
- ./sentinel_backend/scripts:/scripts:ro
- ./sentinel_backend/scripts/docker-init-db-sql.sh:/docker-entrypoint-initdb.d/01-init-schema.sh:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sentinel -d sentinel_db && psql -U sentinel -d sentinel_db -c \"SELECT 1 FROM test_runs LIMIT 1;\" > /dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 15
start_period: 45s
networks:
- sentinel_network
api_gateway:
build:
context: .
dockerfile: sentinel_backend/api_gateway/Dockerfile.prod
container_name: sentinel_api_gateway
env_file:
- sentinel_backend/.env.docker
ports:
- "8000:8000"
depends_on:
- auth_service
- spec_service
- orchestration_service
- data_service
- sentinel_rust_core
networks:
- sentinel_network
auth_service:
build:
context: .
dockerfile: sentinel_backend/auth_service/Dockerfile.prod
container_name: sentinel_auth_service
env_file:
- sentinel_backend/.env.docker
environment:
- SENTINEL_DB_URL=postgresql+asyncpg://sentinel:sentinel_password@db:5432/sentinel_db
working_dir: /app
ports:
- "8005:8005"
depends_on:
db:
condition: service_healthy
networks:
- sentinel_network
spec_service:
build:
context: .
dockerfile: sentinel_backend/spec_service/Dockerfile.prod
container_name: sentinel_spec_service
env_file:
- sentinel_backend/.env.docker
environment:
- SENTINEL_DB_URL=postgresql+asyncpg://sentinel:sentinel_password@db:5432/sentinel_db
working_dir: /app
ports:
- "8001:8001"
depends_on:
db:
condition: service_healthy
networks:
- sentinel_network
orchestration_service:
build:
context: .
dockerfile: sentinel_backend/orchestration_service/Dockerfile.prod
container_name: sentinel_orchestration_service
env_file:
- sentinel_backend/.env.docker
working_dir: /app
ports:
- "8002:8002"
depends_on:
- execution_service
- data_service
- sentinel_rust_core
- message_broker
networks:
- sentinel_network
execution_service:
build:
context: .
dockerfile: sentinel_backend/execution_service/Dockerfile.prod
container_name: sentinel_execution_service
env_file:
- sentinel_backend/.env.docker
environment:
- SENTINEL_DB_URL=postgresql+asyncpg://sentinel:sentinel_password@db:5432/sentinel_db
working_dir: /app
ports:
- "8003:8003"
depends_on:
db:
condition: service_healthy
networks:
- sentinel_network
data_service:
build:
context: .
dockerfile: sentinel_backend/data_service/Dockerfile.prod
container_name: sentinel_data_service
env_file:
- sentinel_backend/.env.docker
environment:
- SENTINEL_DB_URL=postgresql+asyncpg://sentinel:sentinel_password@db:5432/sentinel_db
working_dir: /app
ports:
- "8004:8004"
depends_on:
db:
condition: service_healthy
networks:
- sentinel_network
sentinel_rust_core:
build:
context: .
dockerfile: sentinel_backend/sentinel_rust_core/Dockerfile.prod
container_name: sentinel_rust_core
ports:
- "8088:8088"
environment:
- RUST_LOG=info
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8088/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
depends_on:
- message_broker
networks:
- sentinel_network
message_broker:
image: rabbitmq:3-management
container_name: sentinel_message_broker
ports:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
env_file:
- sentinel_backend/.env.docker
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- sentinel_network
# Observability Services
prometheus:
image: prom/prometheus:latest
container_name: sentinel_prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./sentinel_backend/observability/prometheus/alerts.yml:/etc/prometheus/alerts.yml
- ./sentinel_backend/observability/prometheus/recording_rules.yml:/etc/prometheus/recording_rules.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
- '--storage.tsdb.retention.size=50GB'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
restart: unless-stopped
depends_on:
- api_gateway
- auth_service
- spec_service
- orchestration_service
- execution_service
- data_service
- sentinel_rust_core
networks:
- sentinel_network
jaeger:
image: jaegertracing/all-in-one:latest
container_name: sentinel_jaeger
ports:
- "5775:5775/udp" # Zipkin compact
- "6831:6831/udp" # Jaeger compact thrift
- "6832:6832/udp" # Jaeger binary thrift
- "5778:5778" # Serve configs
- "16686:16686" # Jaeger UI
- "14268:14268" # Jaeger collector HTTP
- "14250:14250" # Jaeger collector gRPC
- "14269:14269" # Jaeger admin/health
- "9411:9411" # Zipkin compatible
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
- COLLECTOR_OTLP_ENABLED=true
- SPAN_STORAGE_TYPE=memory
- METRICS_BACKEND=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
restart: unless-stopped
networks:
- sentinel_network
networks:
sentinel_network:
driver: bridge
volumes:
sentinel_postgres_data:
prometheus_data:
rabbitmq_data:
jaeger_data: