-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.phase3-test.yml
More file actions
430 lines (411 loc) · 13.3 KB
/
Copy pathdocker-compose.phase3-test.yml
File metadata and controls
430 lines (411 loc) · 13.3 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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# Phase 3 E2E Test — Full Payment Sandwich (S1 + S2 + S3 + S4 + S5 + S6 + S7)
#
# Usage:
# ./gradlew jibDockerBuild # Build all images
# docker compose -f docker-compose.phase3-test.yml up -d
# docker compose -f docker-compose.phase3-test.yml ps
# docker compose -f docker-compose.phase3-test.yml down -v
#
# Memory budget (~7.5 GB total):
# Infrastructure: ~3 GB (Postgres, TimescaleDB, Redis, Redpanda, Temporal, WireMock)
# Application: ~3.5 GB (7 services × 512M)
# Headroom: ~5 GB for host OS, IDE, Gradle
services:
# ── Infrastructure ─────────────────────────────────────────────
postgres:
image: postgres:18-alpine
container_name: p3t-postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
POSTGRES_DB: postgres
volumes:
- ./infra/local/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dev"]
interval: 5s
timeout: 5s
retries: 10
timescaledb:
image: timescale/timescaledb:latest-pg17
container_name: p3t-timescaledb
ports:
- "5433:5432"
environment:
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
POSTGRES_DB: fx_rates
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dev"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:8-alpine
container_name: p3t-redis
ports:
- "6379:6379"
deploy:
resources:
limits:
memory: 256M
cpus: '0.25'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:v24.3.18
container_name: p3t-redpanda
command:
- redpanda
- start
- --smp=1
- --memory=512M
- --overprovisioned
- --kafka-addr=internal://0.0.0.0:29092,external://0.0.0.0:9092
- --advertise-kafka-addr=internal://redpanda:29092,external://localhost:9092
ports:
- "9092:9092"
deploy:
resources:
limits:
memory: 640M
cpus: '1.0'
healthcheck:
test: ["CMD-SHELL", "rpk cluster health | grep -q 'Healthy:.*true'"]
interval: 5s
timeout: 5s
retries: 20
start_period: 15s
kafka-init:
image: docker.redpanda.com/redpandadata/redpanda:v24.3.18
container_name: p3t-kafka-init
depends_on:
redpanda:
condition: service_healthy
entrypoint: ["/bin/bash", "-c"]
command: |
"
rpk --brokers redpanda:29092 topic create payment.initiated --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create compliance.result --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create fx.rate.locked --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create fiat.collected --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create fiat.collection.failed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create chain.transfer.submitted --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create chain.transfer.confirmed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create stablecoin.redeemed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create fiat.payout.initiated --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create fiat.payout.completed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create fiat.payout.failed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create payment.completed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create payment.failed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create reconciliation.completed --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create reconciliation.discrepancy --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create audit.event --partitions 3 --replicas 1 --if-not-exists &&
rpk --brokers redpanda:29092 topic create merchant.activated --partitions 3 --replicas 1 --if-not-exists &&
echo 'All topics created'
"
restart: on-failure
temporal:
image: temporalio/auto-setup:1.26.2
container_name: p3t-temporal
ports:
- "7233:7233"
environment:
DB: postgres12
DB_PORT: 5432
POSTGRES_USER: dev
POSTGRES_PWD: dev
POSTGRES_SEEDS: postgres
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "temporal operator cluster health 2>/dev/null | grep -q 'OK' || exit 1"]
interval: 15s
timeout: 10s
retries: 15
temporal-ui:
image: temporalio/ui:2.35.0
container_name: p3t-temporal-ui
ports:
- "8233:8080"
environment:
TEMPORAL_ADDRESS: temporal:7233
depends_on:
- temporal
deploy:
resources:
limits:
memory: 128M
cpus: '0.25'
wiremock:
image: wiremock/wiremock:3.13.0
container_name: p3t-wiremock
ports:
- "4444:8080"
volumes:
- ./infra/local/wiremock/mappings:/home/wiremock/mappings
- ./infra/local/wiremock/__files:/home/wiremock/__files
command: --verbose --global-response-templating
deploy:
resources:
limits:
memory: 256M
cpus: '0.25'
# ── Phase 2 Services (S1, S2, S6) ───────────────────────────────
compliance-travel-rule:
image: stablebridge/compliance-travel-rule:latest
container_name: p3t-compliance
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
redpanda:
condition: service_healthy
wiremock:
condition: service_started
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://postgres:5432/s2_compliance"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: "6379"
APP_SECURITY_ENABLED: "false"
APP_FALLBACK_ADAPTERS_ENABLED: "true"
ports:
- "8083:8083"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8083/compliance/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s
fx-liquidity-engine:
image: stablebridge/fx-liquidity-engine:latest
container_name: p3t-fx-engine
depends_on:
timescaledb:
condition: service_healthy
redis:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://timescaledb:5432/fx_rates"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
REDIS_HOST: redis
REDIS_PORT: "6379"
APP_SECURITY_ENABLED: "false"
APP_FALLBACK_ADAPTERS_ENABLED: "true"
ports:
- "8084:8084"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8084/fx/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s
payment-orchestrator:
image: stablebridge/payment-orchestrator:latest
container_name: p3t-orchestrator
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
redpanda:
condition: service_healthy
temporal:
condition: service_healthy
compliance-travel-rule:
condition: service_started
fx-liquidity-engine:
condition: service_started
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://postgres:5432/s1_payment_orchestrator"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: "6379"
TEMPORAL_ADDRESS: "temporal:7233"
TEMPORAL_NAMESPACE: default
COMPLIANCE_SERVICE_URL: "http://compliance-travel-rule:8083/compliance"
FX_SERVICE_URL: "http://fx-liquidity-engine:8084/fx"
ONRAMP_SERVICE_URL: "http://fiat-on-ramp:8085/on-ramp"
CUSTODY_SERVICE_URL: "http://blockchain-custody:8086/custody"
OFFRAMP_SERVICE_URL: "http://fiat-off-ramp:8087/off-ramp"
LEDGER_SERVICE_URL: "http://ledger-accounting:8088/ledger"
APP_SECURITY_ENABLED: "false"
ports:
- "8082:8082"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8082/orchestrator/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s
# ── Phase 3 Services (S3, S4, S5, S7) ───────────────────────────
fiat-on-ramp:
image: stablebridge/fiat-on-ramp:latest
container_name: p3t-onramp
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
wiremock:
condition: service_started
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://postgres:5432/s3_fiat_on_ramp"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
APP_SECURITY_ENABLED: "false"
APP_PSP_PROVIDER: stripe
APP_PSP_STRIPE_BASEURL: "http://wiremock:8080"
STRIPE_API_KEY: "sk_test_default"
STRIPE_WEBHOOK_SECRET: "whsec_test_default"
ports:
- "8085:8085"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8085/on-ramp/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s
blockchain-custody:
image: stablebridge/blockchain-custody:latest
container_name: p3t-custody
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://postgres:5432/s4_blockchain_custody"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
APP_SECURITY_ENABLED: "false"
APP_CUSTODY_PROVIDER: fallback
APP_FALLBACK_ADAPTERS_ENABLED: "true"
ports:
- "8086:8086"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8086/custody/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s
fiat-off-ramp:
image: stablebridge/fiat-off-ramp:latest
container_name: p3t-offramp
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://postgres:5432/s5_fiat_off_ramp"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
APP_SECURITY_ENABLED: "false"
APP_FALLBACK_ADAPTERS_ENABLED: "true"
ports:
- "8087:8087"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8087/off-ramp/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s
ledger-accounting:
image: stablebridge/ledger-accounting:latest
container_name: p3t-ledger
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
JAVA_TOOL_OPTIONS: "-XX:+UseZGC -XX:MaxRAMPercentage=75.0 -Xss256k"
DB_URL: "jdbc:postgresql://postgres:5432/s7_ledger_accounting"
DB_USER: dev
DB_PASS: dev
KAFKA_BROKERS: "redpanda:29092"
APP_SECURITY_ENABLED: "false"
ports:
- "8088:8088"
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8088/ledger/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
start_period: 180s