-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
301 lines (284 loc) · 10 KB
/
Copy pathdocker-compose.yml
File metadata and controls
301 lines (284 loc) · 10 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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
services:
# =============================================================================
# INFRASTRUCTURE
# =============================================================================
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-nexus_db}
POSTGRES_USER: ${POSTGRES_USER:-nexus}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nexus}
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- nexus
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-nexus} -d ${POSTGRES_DB:-nexus_db}"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
command: redis-server --notify-keyspace-events Ex
ports:
- "6379:6379"
networks:
- nexus
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
otel-collector:
image: otel/opentelemetry-collector:0.114.0
volumes:
- ./otel-collector-config.yaml:/etc/otelcol/config.yaml:ro
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
networks:
- nexus
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:13133/"]
interval: 10s
timeout: 5s
retries: 5
# =============================================================================
# CORTEX (BFF + Frontend)
# =============================================================================
cortex:
build: ./services/cortex
image: ghcr.io/maxanderson95/nexus/cortex:${IMAGE_TAG:-latest}
ports:
- "8080:8080"
environment:
LOGGING_STRUCTURED_FORMAT_CONSOLE: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:-}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
OTEL_SDK_DISABLED: "false"
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: cortex
CHAOS: ${CORTEX_CHAOS:-${CHAOS_DEFAULT:-none}}
SERVICES_DOCKING_URL: http://docking-service:8080
SERVICES_CREW_URL: http://crew-service:8080
SERVICES_LIFE_SUPPORT_URL: http://life-support-service:8080
SERVICES_POWER_URL: http://power-service:8080
SERVICES_INVENTORY_URL: http://inventory-service:8080
networks:
- nexus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# =============================================================================
# BACKEND SERVICES
# =============================================================================
power-service:
build: ./services/power-service
image: ghcr.io/maxanderson95/nexus/power-service:${IMAGE_TAG:-latest}
environment:
LOGGING_STRUCTURED_FORMAT_CONSOLE: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:-}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
OTEL_SDK_DISABLED: "false"
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: power-service
CHAOS: ${POWER_CHAOS:-${CHAOS_DEFAULT:-none}}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-nexus_db}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-nexus}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-nexus}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
networks:
- nexus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
life-support-service:
build: ./services/life-support-service
image: ghcr.io/maxanderson95/nexus/life-support-service:${IMAGE_TAG:-latest}
environment:
LOGGING_STRUCTURED_FORMAT_CONSOLE: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:-}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
OTEL_SDK_DISABLED: "false"
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: life-support-service
CHAOS: ${LIFE_SUPPORT_CHAOS:-${CHAOS_DEFAULT:-none}}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-nexus_db}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-nexus}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-nexus}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
SERVICES_POWER_URL: http://power-service:8080
networks:
- nexus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
crew-service:
build: ./services/crew-service
image: ghcr.io/maxanderson95/nexus/crew-service:${IMAGE_TAG:-latest}
environment:
LOGGING_STRUCTURED_FORMAT_CONSOLE: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:-}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
OTEL_SDK_DISABLED: "false"
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: crew-service
CHAOS: ${CREW_CHAOS:-${CHAOS_DEFAULT:-none}}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-nexus_db}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-nexus}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-nexus}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
SERVICES_LIFE_SUPPORT_URL: http://life-support-service:8080
networks:
- nexus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
docking-service:
build: ./services/docking-service
image: ghcr.io/maxanderson95/nexus/docking-service:${IMAGE_TAG:-latest}
environment:
LOGGING_STRUCTURED_FORMAT_CONSOLE: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:-}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
OTEL_SDK_DISABLED: "false"
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: docking-service
CHAOS: ${DOCKING_CHAOS:-${CHAOS_DEFAULT:-none}}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-nexus_db}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-nexus}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-nexus}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
SERVICES_POWER_URL: http://power-service:8080
SERVICES_CREW_URL: http://crew-service:8080
SERVICES_INVENTORY_URL: http://inventory-service:8080
networks:
- nexus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
inventory-service:
build: ./services/inventory-service
image: ghcr.io/maxanderson95/nexus/inventory-service:${IMAGE_TAG:-latest}
environment:
LOGGING_STRUCTURED_FORMAT_CONSOLE: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:-}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
OTEL_SDK_DISABLED: "false"
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: inventory-service
CHAOS: ${INVENTORY_CHAOS:-${CHAOS_DEFAULT:-none}}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-nexus_db}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-nexus}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-nexus}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
SERVICES_DOCKING_URL: http://docking-service:8080
SERVICES_CREW_URL: http://crew-service:8080
networks:
- nexus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# =============================================================================
# LOAD GENERATOR (optional - use with: docker compose --profile load up)
# =============================================================================
load-generator:
build: ./load-generator
image: ghcr.io/maxanderson95/nexus/load-generator:${IMAGE_TAG:-latest}
environment:
LOCUST_HOST: http://cortex:8080
LOCUST_HEADLESS: "true"
LOCUST_USERS: ${LOAD_USERS:-2}
LOCUST_SPAWN_RATE: ${LOAD_SPAWN_RATE:-1}
ports:
- "8089:8089"
networks:
- nexus
profiles:
- load
depends_on:
cortex:
condition: service_healthy
logging:
driver: "none"
# =============================================================================
# RUM LOAD GENERATOR (optional - use with: docker compose --profile load-rum up)
# Playwright-based browser load testing for Real User Monitoring metrics
# =============================================================================
rum-load-generator:
build: ./rum-load-generator
image: ghcr.io/maxanderson95/nexus/rum-load-generator:${IMAGE_TAG:-latest}
environment:
TARGET_URL: http://cortex:8080
BROWSER_COUNT: ${RUM_BROWSERS:-2}
ITERATIONS: ${RUM_ITERATIONS:-0}
HEADLESS: "true"
MIN_THINK_TIME: 500
MAX_THINK_TIME: 2000
MIN_SCENARIO_WAIT: 3000
MAX_SCENARIO_WAIT: 8000
LOG_FORMAT: text
WEIGHT_DASHBOARD: 30
WEIGHT_DOCKING: 20
WEIGHT_LIFE_SUPPORT: 15
WEIGHT_POWER: 15
WEIGHT_CREW: 10
WEIGHT_INVENTORY: 10
networks:
- nexus
profiles:
- load-rum
depends_on:
cortex:
condition: service_healthy
shm_size: '2gb'
networks:
nexus:
driver: bridge
volumes:
postgres_data: