-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
580 lines (558 loc) · 18.2 KB
/
docker-compose.yml
File metadata and controls
580 lines (558 loc) · 18.2 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
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
574
575
576
577
578
579
580
services:
client:
container_name: nf4_client
stop_grace_period: 3s
profiles:
- client
- development
- sync_test
- no_test
build:
dockerfile: nightfall_client/Dockerfile
context: .
stdin_open: true # keep stdin open, so we can print things in docker compose up
platform: linux/amd64 # Required for building on M1 Macs
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:3000/v1/health"]
interval: 5s
timeout: 90s
retries: 10
start_period: 0s
networks:
- nightfall_network
volumes:
- type: volume
source: address_data
target: /app/configuration/toml
read_only: true
depends_on:
db_client:
condition: service_healthy
anvil:
condition: service_healthy
deployer:
condition: service_completed_successfully
proposer:
condition: service_healthy
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- RUST_LOG=${RUST_LOG:-info}
- NF4_NETWORK__LOG_CHUNK_SIZE=${NF4_NETWORK__LOG_CHUNK_SIZE:-}
- NF4_SIGNING_KEY=${CLIENT_SIGNING_KEY}
- NF4_NIGHTFALL_CLIENT__DB_URL=mongodb://nf4_db_client:27017
- AZURE_VAULT_URL=${AZURE_VAULT_URL}
- AZURE_KEY_NAME=${CLIENT_SIGNING_KEY_NAME}
- CLIENT_SIGNING_KEY_NAME=${CLIENT_SIGNING_KEY_NAME}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
indie-client:
container_name: nf4_indie_client
stop_grace_period: 3s
profiles:
- indie-client
build:
dockerfile: nightfall_client/Dockerfile
context: .
stdin_open: true # keep stdin open, so we can print things in docker compose up
platform: linux/amd64 # Required for building on M1 Macs
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:3000/v1/health"]
interval: 5s
timeout: 90s
retries: 10
start_period: 0s
networks:
- nightfall_network
depends_on:
db_client:
condition: service_healthy
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-base_sepolia}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${CLIENT_SIGNING_KEY}
- NF4_NIGHTFALL_CLIENT__DB_URL=mongodb://nf4_db_client:27017
- NF4_ETHEREUM_CLIENT_URL
- NF4_MOCK_PROVER=${NF4_MOCK_PROVER:-false}
- NF4_NIGHTFALL_PROPOSER__URL=${NF4_NIGHTFALL_PROPOSER__URL:-localhost:3001}
client2:
container_name: nf4_client2
stop_grace_period: 3s
profiles:
- client
- sync_test
- development
- no_test
build:
dockerfile: nightfall_client/Dockerfile
context: .
# command: ["tail", "-f","/dev/null"] # For debugging if required
stdin_open: true # keep stdin open, so we can print things in docker compose up
platform: linux/amd64 # Required for building on M1 Macs
ports:
- "3002:3000"
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:3000/v1/health"]
interval: 5s
timeout: 90s
retries: 10
start_period: 0s
networks:
- nightfall_network
volumes:
- type: volume
source: address_data
target: /app/configuration/toml
read_only: true
depends_on:
db_client2:
condition: service_healthy
anvil:
condition: service_healthy
deployer:
condition: service_completed_successfully
proposer:
condition: service_healthy
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${CLIENT2_SIGNING_KEY}
- NF4_NIGHTFALL_CLIENT__DB_URL=mongodb://nf4_db_client2:27017
- NF4_NIGHTFALL_CLIENT__LOG_LEVEL=info # Mostly the client2 logs are a repeat of client1 logs, so we can reduce the log level to error
- AZURE_VAULT_URL=${AZURE_VAULT_URL}
- AZURE_KEY_NAME=${CLIENT_SIGNING_KEY_NAME}
- CLIENT_SIGNING_KEY_NAME=${CLIENT2_SIGNING_KEY_NAME}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
- WEBHOOK_URL=${WEBHOOK_URL}
proposer:
container_name: nf4_proposer
stop_grace_period: 3s
profiles:
- proposer
- development
- sync_test
- no_test
build:
dockerfile: nightfall_proposer/Dockerfile
context: .
platform: linux/amd64 # Required for building on M1 Macs
ports:
- "3001:3000"
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:3000/v1/health"]
interval: 5s
timeout: 90s
retries: 10
start_period: 0s
networks:
- nightfall_network
volumes:
- type: volume
source: address_data
target: /app/configuration/toml
read_only: true
depends_on:
db_proposer:
condition: service_healthy
anvil:
condition: service_healthy
deployer:
condition: service_completed_successfully
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- RUST_LOG=${RUST_LOG:-info}
- NF4_NETWORK__LOG_CHUNK_SIZE=${NF4_NETWORK__LOG_CHUNK_SIZE:-}
- NF4_SIGNING_KEY=${PROPOSER_SIGNING_KEY}
- NF4_MOCK_PROVER=${NF4_MOCK_PROVER:-true}
- AZURE_VAULT_URL=${AZURE_VAULT_URL}
- PROPOSER_SIGNING_KEY_NAME=${PROPOSER_SIGNING_KEY_NAME}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
indie-proposer:
container_name: nf4_indie_proposer
stop_grace_period: 3s
profiles:
- indie-proposer
build:
dockerfile: nightfall_proposer/Dockerfile
context: .
platform: linux/amd64 # Required for building on M1 Macs
restart: unless-stopped
ports:
- "3001:3000"
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:3000/v1/health"]
interval: 5s
timeout: 90s
retries: 10
start_period: 0s
networks:
- nightfall_network
depends_on:
db_proposer:
condition: service_healthy
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-base_sepolia}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${PROPOSER_SIGNING_KEY}
- NF4_MOCK_PROVER=${NF4_MOCK_PROVER:-false}
- NF4_ETHEREUM_CLIENT_URL
- NF4_CONTRACTS__DEPLOY_CONTRACTS=${NF4_CONTRACTS__DEPLOY_CONTRACTS:-false}
proposer2:
container_name: nf4_proposer2
stop_grace_period: 3s
profiles:
- sync_test
build:
dockerfile: nightfall_proposer/Dockerfile
context: .
platform: linux/amd64 # Required for building on M1 Macs
ports:
- "3003:3000"
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:3000/v1/health"]
interval: 5s
timeout: 90s
retries: 10
start_period: 0s
networks:
- nightfall_network
volumes:
- type: volume
source: address_data
target: /app/configuration/toml
read_only: true
depends_on:
db_proposer2:
condition: service_healthy
test:
condition: service_completed_successfully
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${PROPOSER_2_SIGNING_KEY}
- NF4_PROPOSER_CONFIG=nightfall_proposer2
- NF4_MOCK_PROVER=${NF4_MOCK_PROVER:-true}
- AZURE_VAULT_URL=${AZURE_VAULT_URL}
- PROPOSER_SIGNING_KEY_NAME=${PROPOSER_2_SIGNING_KEY_NAME}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
- NF4_NIGHTFALL_PROPOSER__URL=http://proposer2:3000
- NF4_NIGHTFALL_PROPOSER__DB_URL=mongodb://nf4_db_proposer2:27017
db_client:
container_name: nf4_db_client
stop_grace_period: 3s
profiles:
- client
- indie-client
- development
- sync_test
- no_test
image: mongo:8.0
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017 --quiet || exit 1
interval: 10s
timeout: 90s
retries: 10
start_period: 0s
command: mongod --quiet --logpath /dev/null
ports:
- "27017:27017"
networks:
- nightfall_network
# volumes:
# - mongodb_client_data:/data/db
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
db_client2:
container_name: nf4_db_client2
stop_grace_period: 3s
profiles:
- client
- sync_test
- development
- no_test
image: mongo:8.0
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017 --quiet || exit 1
interval: 10s
timeout: 90s
retries: 10
start_period: 0s
command: mongod --quiet --logpath /dev/null
ports:
- "27020:27017"
networks:
- nightfall_network
# volumes:
# - mongodb_client2_data:/data/db
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
db_proposer:
container_name: nf4_db_proposer
stop_grace_period: 3s
profiles:
- proposer
- indie-proposer # We'll reuse the db_proposer for the indie-proposer as this will never run at the same time as the proposer
- development
- sync_test
- no_test
image: mongo:8.0
restart: unless-stopped
ports:
- "27018:27017"
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017 --quiet || exit 1
interval: 10s
timeout: 90s
retries: 10
start_period: 0s
command: mongod --quiet --logpath /dev/null
networks:
- nightfall_network
# volumes:
# - mongodb_proposer_data:/data/db
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
db_proposer2:
container_name: nf4_db_proposer2
stop_grace_period: 3s
profiles:
- sync_test
image: mongo:8.0
ports:
- "27019:27017"
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017 --quiet || exit 1
interval: 10s
timeout: 90s
retries: 10
start_period: 0s
command: mongod --quiet --logpath /dev/null
networks:
- nightfall_network
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
deployer:
container_name: nf4_deployer
stop_grace_period: 3s
profiles:
- deployer
- development
- sync_test
- no_test
build:
dockerfile: nightfall_deployer/Dockerfile
context: .
ulimits:
nofile:
soft: 65536
hard: 65536
platform: linux/amd64 # Required for building on M1 Macs
# command: ["tail", "-f","/dev/null"] # For debugging if required
networks:
- nightfall_network
volumes:
- ./blockchain_assets/test_contracts:/test_contracts
- ./blockchain_assets/logs:/app/blockchain_assets/logs # to be able to see deployed contract addresses locally
- type: volume
source: address_data
target: /app/configuration/toml
read_only: false
depends_on:
anvil:
condition: service_healthy
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- NF4_CONTRACTS__DEPLOY_CONTRACTS=${NF4_CONTRACTS__DEPLOY_CONTRACTS:-true}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${DEPLOYER_SIGNING_KEY}
- CLIENT_ADDRESS=${CLIENT_ADDRESS}
- NF4_MOCK_PROVER=${NF4_MOCK_PROVER:-true}
- AZURE_VAULT_URL=${AZURE_VAULT_URL}
- DEPLOYER_SIGNING_KEY_NAME=${DEPLOYER_SIGNING_KEY_NAME}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
indie-deployer:
container_name: nf4_indie_deployer
stop_grace_period: 3s
profiles:
- indie-deployer
build:
dockerfile: nightfall_deployer/Dockerfile
context: .
platform: linux/amd64 # Required for building on M1 Macs
# command: ["tail", "-f","/dev/null"] # For debugging if required
networks:
- nightfall_network
volumes:
- ./blockchain_assets/test_contracts:/test_contracts
- ./blockchain_assets/logs:/app/blockchain_assets/logs # to be able to see deployed contract addresses locally
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-base_sepolia}
- NF4_CONTRACTS__DEPLOY_CONTRACTS=${NF4_CONTRACTS__DEPLOY_CONTRACTS:-true}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${DEPLOYER_SIGNING_KEY}
- CLIENT_ADDRESS=${CLIENT_ADDRESS}
- NF4_MOCK_PROVER=${NF4_MOCK_PROVER:-false}
- NF4_ETHEREUM_CLIENT_URL
configuration:
container_name: nf4_configuration
stop_grace_period: 3s
profiles:
- configuration
- development
- sync_test
- no_test
build:
dockerfile: configuration/Dockerfile
context: .
# restart: unless-stopped
# ports:
# - "8080:80" replace with a port that is exposed for configuration service if required
platform: linux/amd64 # Required for building on M1 Macs
volumes:
- type: bind
source: ./configuration/toml
target: /var/www/html/configuration/toml
read_only: false
networks:
- nightfall_network
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NGINX_ENTRYPOINT_QUIET_LOGS=1
anvil:
container_name: anvil
stop_grace_period: 3s
profiles:
- development
- sync_test
- anvil
- no_test
build:
dockerfile: anvil/Dockerfile
context: .
platform: linux/amd64 # Required for building on M1 Macs
healthcheck:
test: ["CMD", "curl", "-H", "Content-Type:", "application/json", "-X", "POST", "--data", '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}', "0.0.0.0:8545"]
interval: 10s
timeout: 90s
retries: 10
start_period: 0s
volumes:
- ./blockchain_assets/logs:/blockchain_assets/logs # to be able to see deployed contract addresses locally
networks:
- nightfall_network
ports:
- "8545:8545"
environment:
- NF4_SIGNING_KEY=${DEPLOYER_SIGNING_KEY}
test:
container_name: nf4_test
stop_grace_period: 3s
profiles:
- development
- sync_test
- no_deployment
build:
dockerfile: nightfall_test/Dockerfile
context: .
platform: linux/amd64 # Required for building on M1 Macs
# command: ["tail", "-f","/dev/null"] # For debugging if required
volumes:
- ./blockchain_assets/logs:/app/blockchain_assets/logs # to be able to see deployed contract addresses locally
- type: volume
source: address_data
target: /app/configuration/toml
read_only: true
# Give the test container a static IP address so it can be contacted by the clients' webhooks. It doesn't get added to the dns with 'docker compose run test'
networks:
nightfall_network:
ipv4_address: 172.18.0.250
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${DEPLOYER_SIGNING_KEY}
- NF4_CONTRACTS__DEPLOY_CONTRACTS=${NF4_CONTRACTS__DEPLOY_CONTRACTS:-true}
- CLIENT_ADDRESS=${CLIENT_ADDRESS}
- NF4_LARGE_BLOCK_TEST=${NF4_LARGE_BLOCK_TEST:-false} # Set to true to run large block tests
- AZURE_VAULT_URL=${AZURE_VAULT_URL}
- AZURE_KEY_NAME=${CLIENT_SIGNING_KEY_NAME}
- AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
- AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
- AZURE_TENANT_ID=${AZURE_TENANT_ID}
depends_on:
client:
condition: service_healthy
client2:
condition: service_healthy
proposer:
condition: service_healthy
sync_test:
container_name: nf4_sync_test
stop_grace_period: 3s
profiles:
- sync_test
build:
dockerfile: nightfall_sync_test/Dockerfile
context: .
volumes:
- ./blockchain_assets/logs:/app/blockchain_assets/logs # to be able to see deployed contract addresses locally
- type: volume
source: address_data
target: /app/configuration/toml
read_only: true
platform: linux/amd64 # Required for building on M1 Macs
networks:
- nightfall_network
stdin_open: true # keep stdin open, so we can print things in docker compose up
tty: true # required for logs to print in colour
environment:
- NF4_RUN_MODE=${NF4_RUN_MODE:-development}
- RUST_BACKTRACE=${RUST_BACKTRACE:-0}
- NF4_SIGNING_KEY=${DEPLOYER_SIGNING_KEY}
depends_on:
proposer:
condition: service_healthy
proposer2:
condition: service_healthy
volumes:
# mongodb_client_data:
# mongodb_client2_data:
# mongodb_proposer_data:
address_data:
networks:
nightfall_network:
ipam:
driver: default
config:
- subnet: "172.18.0.0/24"