-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yaml
573 lines (568 loc) · 16.7 KB
/
docker-compose.yaml
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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
services:
governance-ga-wallets-db:
image: postgres:16-alpine
container_name: governance-ga-wallets-db
command: postgres -c listen_addresses='*' -c 'max_connections=500'
env_file:
- environments/governance-ga/db.default.env
volumes:
- ./resources/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- governance-ga
- host
tty: true
# ngrok-governance-ga:
# image: wernight/ngrok
# env_file:
# - environments/governance-ga/aca-py-agent.default.env
# command: ngrok http governance-ga-agent:3020 --log stdout
# networks:
# - governance-ga
# - host
# depends_on:
# - ledger-nodes
# - ledger-browser
governance-ga-agent:
image: ${REGISTRY:-local}/governance-ga-agent:${IMAGE_TAG:-latest}
container_name: governance-ga-agent
build:
context: .
dockerfile: dockerfiles/agents/Dockerfile.agent
env_file:
- environments/governance-ga/aca-py-agent.default.env
environment:
ACAPY_AUTO_ENDORSE_TRANSACTIONS: false
ports:
- 0.0.0.0:3020:3020
- 0.0.0.0:3021:3021
depends_on:
governance-ga-wallets-db:
condition: service_started
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
nats-1:
condition: service_started
nats-2:
condition: service_started
nats-3:
condition: service_started
networks:
- governance-ga
- host
- nats
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3021/status/ready"]
interval: 15s
timeout: 5s
retries: 10
start_period: 15s
governance-trust-registry:
image: ${REGISTRY:-local}/governance-trust-registry:${IMAGE_TAG:-latest}
container_name: governance-trust-registry
build:
context: .
dockerfile: ./dockerfiles/trustregistry/Dockerfile
env_file:
- environments/trustregistry/trustregistry.default.env
ports:
- 0.0.0.0:8001:8001
volumes:
- ./trustregistry:/trustregistry
- ./logs:/logs
networks:
- governance-ga
- governance-multitenant
- host
depends_on:
trustregistry-db:
condition: service_healthy
trustregistry-db:
image: postgres:16-alpine
container_name: trustregistry-db
command: postgres -c listen_addresses='*' -c 'max_connections=500'
environment:
- POSTGRES_DB=trustregistry
- POSTGRES_USER=trustregistry
- POSTGRES_PASSWORD=trustregistry
- PGUSER=trustregistry
ports:
- 0.0.0.0:5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- governance-ga
- governance-multitenant
- host
tty: true
governance-multitenant-web:
image: ${REGISTRY:-local}/governance-multitenant-web:${IMAGE_TAG:-latest}
container_name: governance-multitenant-web
build:
context: .
dockerfile: ./dockerfiles/fastapi/Dockerfile
ports:
- 0.0.0.0:8100:8000
volumes:
- ./app:/app
- ./environments/governance-multitenant/fastapi.default.env:/app/.env
- ./logs/multitenant:/logs
depends_on:
governance-multitenant-wallets-db:
condition: service_started
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
governance-ga-agent:
condition: service_healthy
governance-multitenant-agent:
condition: service_healthy
networks:
- governance-multitenant
- host
env_file:
- environments/governance-multitenant/fastapi.default.env
governance-ga-web:
image: ${REGISTRY:-local}/governance-ga-web:${IMAGE_TAG:-latest}
container_name: governance-ga-web
build:
context: .
dockerfile: ./dockerfiles/fastapi/Dockerfile
ports:
- 0.0.0.0:8200:8000
volumes:
- ./app:/app
- ./environments/governance-ga/fastapi.default.env:/app/.env
- ./logs/ga:/logs
depends_on:
governance-ga-wallets-db:
condition: service_started
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
governance-ga-agent:
condition: service_healthy
networks:
- governance-ga
- host
env_file:
- environments/governance-ga/fastapi.default.env
governance-tenant-web:
image: ${REGISTRY:-local}/governance-tenant-web:${IMAGE_TAG:-latest}
container_name: governance-tenant-web
build:
context: .
dockerfile: ./dockerfiles/fastapi/Dockerfile
ports:
- 0.0.0.0:8300:8000
volumes:
- ./app:/app
- ./environments/governance-tenant/fastapi.default.env:/app/.env
- ./logs/tenant:/logs
depends_on:
governance-multitenant-wallets-db:
condition: service_started
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
governance-ga-agent:
condition: service_healthy
governance-multitenant-agent:
condition: service_healthy
networks:
- governance-multitenant
- host
env_file:
- environments/governance-tenant/fastapi.default.env
governance-public-web:
image: ${REGISTRY:-local}/governance-public-web:${IMAGE_TAG:-latest}
container_name: governance-public-web
build:
context: .
dockerfile: ./dockerfiles/fastapi/Dockerfile
ports:
- 0.0.0.0:8400:8000
volumes:
- ./app:/app
- ./environments/governance-public/fastapi.default.env:/app/.env
- ./logs/tenant:/logs
depends_on:
governance-multitenant-wallets-db:
condition: service_started
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
governance-ga-agent:
condition: service_healthy
governance-multitenant-agent:
condition: service_healthy
networks:
- governance-multitenant
- host
env_file:
- environments/governance-public/fastapi.default.env
governance-endorser:
image: ${REGISTRY:-local}/governance-endorser:${IMAGE_TAG:-latest}
container_name: governance-endorser
build:
context: .
dockerfile: ./dockerfiles/endorser/Dockerfile
ports:
- 0.0.0.0:3009:3009
volumes:
- ./endorser:/endorser
- ./logs:/logs
networks:
- governance-multitenant
- governance-ga
- host
env_file:
- environments/endorser/endorser.env
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3009/health/ready || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
waypoint:
image: ${REGISTRY:-local}/waypoint:${IMAGE_TAG:-latest}
container_name: waypoint
build:
context: .
dockerfile: ./dockerfiles/waypoint/Dockerfile
ports:
- 0.0.0.0:3011:3011
volumes:
- ./waypoint:/waypoint
- ./logs:/logs
networks:
- governance-multitenant
- host
- nats
depends_on:
- governance-endorser
- nats-1
- nats-2
- nats-3
env_file:
- environments/waypoint/waypoint.env
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3011/health/ready || exit 1"]
interval: 5s
timeout: 10s
retries: 3
start_period: 5s
governance-multitenant-wallets-db:
image: postgres:16-alpine
container_name: governance-multitenant-wallets-db
command: postgres -c listen_addresses='*' -c 'max_connections=500'
env_file:
- environments/governance-multitenant/db.default.env
volumes:
- ./resources/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- governance-multitenant
- host
tty: true
ngrok-governance-multitenant:
image: wernight/ngrok
container_name: ngrok-governance-multitenant
env_file:
- environments/governance-multitenant/aca-py-agent.default.env
command: ngrok http governance-multitenant-agent:3020 --log stdout
networks:
- governance-multitenant
- host
depends_on:
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
governance-multitenant-agent:
image: ${REGISTRY:-local}/governance-multitenant-agent:${IMAGE_TAG:-latest}
container_name: governance-multitenant-agent
build:
context: .
dockerfile: dockerfiles/agents/Dockerfile.author.agent
# To run a forked version of the agent use commented out code below
# context: https://github.com/ff137/aries-cloudagent-python.git#feat/pagination-ordering
# dockerfile: docker/Dockerfile
# user: root
# entrypoint:
# - sh
# - -c
# - |
# pip install --no-cache-dir git+https://github.com/didx-xyz/acapy-wallet-groups-plugin@test/feat/pagination-ordering
# pip install --no-cache-dir git+https://github.com/didx-xyz/aries-acapy-plugins@v1-2024-10-09#subdirectory=nats_events
# aca-py start \
# -it http "0.0.0.0" "3020" \
# -e http://governance-multitenant-agent:3020 \
# --wallet-type askar --auto-promote-author-did --plugin acapy_wallet_groups_plugin \
# --plugin nats_events.v1_0.nats_queue.events --plugin-config-value nats_queue.connection.connection_url="nats://nats-1:4222"
env_file:
- environments/governance-multitenant/aca-py-agent.default.env
ports:
- 0.0.0.0:4020:3020
- 0.0.0.0:4021:3021
depends_on:
governance-multitenant-wallets-db:
condition: service_started
ledger-nodes:
condition: service_healthy
ledger-browser:
condition: service_healthy
nats-1:
condition: service_started
nats-2:
condition: service_started
nats-3:
condition: service_started
networks:
- governance-multitenant
- governance-ga
- host
- nats
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3021/status/ready"]
interval: 15s
timeout: 5s
retries: 10
start_period: 15s
ledger-browser:
image: ${REGISTRY:-local}/ledger-nodes:${IMAGE_TAG:-latest}
container_name: ledger-browser
build:
context: https://github.com/bcgov/von-network.git#v1.8.0
dockerfile: Dockerfile
command: "bash -c './scripts/start_webserver.sh'"
environment:
- DOCKERHOST=${DOCKERHOST}
- MAX_FETCH=50000
- RESYNC_TIME=120
- REGISTER_NEW_DIDS=True
- LEDGER_INSTANCE_NAME=localhost
- LOG_LEVEL=WARNING
# - POOL_CONNECTION_ATTEMPTS=${POOL_CONNECTION_ATTEMPTS:-5}
# - POOL_CONNECTION_DELAY=${POOL_CONNECTION_DELAY:-10}
- LEDGER_SEED=${LEDGER_SEED:-000000000000000000000000Trustee1}
ports:
- ${WEB_SERVER_HOST_PORT:-9000}:8000
volumes:
- webserver-cli:/home/indy/.indy-cli
- webserver-ledger:/home/indy/ledger
- ./resources/ledger-nodes/aml.json:/home/indy/config/aml.json
- ./resources/ledger-nodes/taa.json:/home/indy/config/taa.json
networks:
- governance-multitenant
- governance-ga
- host
healthcheck:
test: ["CMD", "curl", "-f", "http://ledger-browser:8000"]
interval: 15s
timeout: 5s
retries: 10
start_period: 15s
depends_on:
ledger-nodes:
condition: service_healthy
ledger-nodes:
image: ${REGISTRY:-local}/ledger-nodes:${IMAGE_TAG:-latest}
container_name: ledger-nodes
build:
context: https://github.com/bcgov/von-network.git#v1.8.0
dockerfile: Dockerfile
command: "bash -c './scripts/start_nodes.sh'"
ports:
- 0.0.0.0:9701:9701
- 0.0.0.0:9702:9702
- 0.0.0.0:9703:9703
- 0.0.0.0:9704:9704
- 0.0.0.0:9705:9705
- 0.0.0.0:9706:9706
- 0.0.0.0:9707:9707
- 0.0.0.0:9708:9708
environment:
- DOCKERHOST=${DOCKERHOST}
- LOG_LEVEL=WARNING
volumes:
- nodes-data:/home/indy/ledger
- ./scripts/indy_healthcheck.sh:/home/indy/indy_healthcheck.sh
networks:
- governance-multitenant
- governance-ga
- host
healthcheck:
test: ["CMD-SHELL", "/home/indy/indy_healthcheck.sh"]
interval: 30s
timeout: 15s
retries: 10
start_period: 30s
tails-server:
image: ${REGISTRY:-local}/tails-server:${IMAGE_TAG:-latest}
container_name: tails-server
build:
context: https://github.com/bcgov/indy-tails-server.git#v1.1.0
dockerfile: docker/Dockerfile.tails-server
ports:
- 0.0.0.0:6543:6543
networks:
- governance-multitenant
- governance-ga
- host
environment:
- DOCKERHOST=${DOCKERHOST}
command: >
tails-server
--host 0.0.0.0
--port 6543
--storage-path ./
--log-level INFO
tests:
image: local/tests
container_name: tests
restart: "no"
build:
context: .
dockerfile: ./dockerfiles/tests/Dockerfile
command:
- /bin/sh
- -c
- |-
poetry run pytest --junitxml="/tests/outputs/test_output_$(date +'%Y-%m-%d_%H-%M-%S').xml"
environment:
ACAPY_GOVERNANCE_AGENT_URL: http://governance-ga-agent:3021
ACAPY_GOVERNANCE_AGENT_API_KEY: adminApiKey
ACAPY_TENANT_AGENT_URL: http://governance-multitenant-agent:3021
ACAPY_TENANT_AGENT_API_KEY: adminApiKey
TRUST_REGISTRY_URL: http://governance-trust-registry:8001
ACAPY_MULTITENANT_JWT_SECRET: jwtSecret
GOVERNANCE_FASTAPI_ENDPOINT: http://governance-multitenant-web:8000
GOVERNANCE_ACAPY_API_KEY: adminApiKey
TENANT_FASTAPI_ENDPOINT: http://governance-multitenant-web:8000
TENANT_ACAPY_API_KEY: adminApiKey
LEDGER_REGISTRATION_URL: http://ledger-browser:8000/register
volumes:
- ./logs/containerized-tests:/tests/outputs
- ./scripts/test_runner.sh:/tests/test_runner.sh
networks:
- governance-ga
- host
depends_on:
governance-multitenant-web-health:
condition: service_completed_successfully
pytest:
image: local/tests
container_name: loop_tests
restart: "no"
build:
context: .
dockerfile: ./dockerfiles/tests/Dockerfile
command:
- /bin/sh
- -c
- |-
./test_runner.sh 5 poetry run pytest
environment:
ACAPY_GOVERNANCE_AGENT_URL: http://governance-ga-agent:3021
ACAPY_GOVERNANCE_AGENT_API_KEY: adminApiKey
ACAPY_TENANT_AGENT_URL: http://governance-multitenant-agent:3021
ACAPY_TENANT_AGENT_API_KEY: adminApiKey
TRUST_REGISTRY_URL: http://governance-trust-registry:8001
ACAPY_MULTITENANT_JWT_SECRET: jwtSecret
GOVERNANCE_FASTAPI_ENDPOINT: http://governance-multitenant-web:8000
GOVERNANCE_ACAPY_API_KEY: adminApiKey
TENANT_FASTAPI_ENDPOINT: http://governance-multitenant-web:8000
TENANT_ACAPY_API_KEY: adminApiKey
LEDGER_REGISTRATION_URL: http://ledger-browser:8000/register
volumes:
- ./logs/containerized-tests:/tests/outputs
- ./scripts/test_runner.sh:/tests/test_runner.sh
networks:
- governance-ga
- host
governance-multitenant-web-health:
image: curlimages/curl
container_name: governance-multitenant-web-health
restart: "no"
command:
- /bin/sh
- -c
- |-
until curl -fsS http://governance-multitenant-web:8000/docs; do sleep 5; done
networks:
- governance-ga
- host
depends_on:
governance-multitenant-web:
condition: service_started
nats-1:
image: nats:alpine
ports:
- "8222:8222"
- "4222:4222"
command: "-c /etc/nats/nats.conf --server_name nats-1"
volumes:
- nats-data-1:/nats-data
- ./resources/nats-local.conf:/etc/nats/nats.conf
networks:
- nats
labels:
app: nats
tier: infra
healthcheck:
test: ["CMD-SHELL", 'wget -qO- localhost:8222/healthz | grep ''"status":"ok"'' || exit 1']
start_period: 30s
interval: 10s
timeout: 10s
retries: 5
nats-2:
image: nats
command: "-c /etc/nats/nats.conf --server_name nats-2"
volumes:
- nats-data-2:/nats-data
- ./resources/nats-local.conf:/etc/nats/nats.conf
networks:
- nats
depends_on:
nats-1:
condition: service_started
labels:
app: nats
tier: infra
nats-3:
image: nats
command: "-c /etc/nats/nats.conf --server_name nats-3"
volumes:
- nats-data-3:/nats-data
- ./resources/nats-local.conf:/etc/nats/nats.conf
networks:
- nats
depends_on:
nats-1:
condition: service_started
labels:
app: nats
tier: infra
volumes:
webserver-cli:
webserver-ledger:
nodes-data:
data:
nats-data-1:
nats-data-2:
nats-data-3:
networks:
governance-multitenant:
governance-ga:
host:
nats: