forked from DashNode-Org/dashtec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
449 lines (433 loc) · 15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
449 lines (433 loc) · 15 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
version: "3.8"
services:
web:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
NETWORK: mainnet
image: dashtec-web:latest
container_name: dashtec-web
ports:
- "${WEB_PORT:-3000}:3000"
env_file:
- apps/web/.env.mainnet
environment:
DATABASE_URL: postgresql://dashtec:dashtec@${DB_HOST:-postgres-mainnet}:5432/dashtec
REDIS_URL: redis://:dashtec@${REDIS_HOST:-redis-mainnet}:6379
DATABASE_URL_REPLICA: postgresql://dashtec:dashtec@${DB_HOST:-postgres-mainnet}:5432/dashtec
NEXT_SENTINEL_URL: ${NEXT_SENTINEL_URL}
depends_on:
aztec-node-mainnet:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
profiles:
- mainnet
indexer-ponder:
build:
context: .
dockerfile: packages/indexer-ponder/Dockerfile
image: dashtec-indexer-ponder:latest
container_name: dashtec-indexer-ponder
ports:
- "${PONDER_PORT:-42069}:42069"
env_file:
- packages/indexer-ponder/.env.mainnet
environment:
DATABASE_SCHEMA: ponder_prod
DATABASE_URL: postgresql://dashtec:dashtec@${DB_HOST:-postgres-mainnet}:5432/dashtec
REDIS_URL: redis://:dashtec@${REDIS_HOST:-redis-mainnet}:6379
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:42069/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
profiles:
- mainnet
indexer-custom:
build:
context: .
dockerfile: packages/indexer-custom/Dockerfile
image: dashtec-indexer-custom:latest
container_name: dashtec-indexer-custom
# Default command runs all collectors (see Dockerfile CMD)
ports:
- "${COLLECTOR_VALIDATOR_STATS_PORT:-4000}:4000"
- "${COLLECTOR_VALIDATOR_LIST_PORT:-4001}:4001"
- "${COLLECTOR_EPOCH_INTEGRITY_PORT:-4002}:4002"
- "${COLLECTOR_VALIDATOR_MIGRATION_PORT:-4003}:4003"
- "${COLLECTOR_PROVIDER_LIST_PORT:-4004}:4004"
env_file:
- packages/indexer-custom/.env.mainnet
environment:
DATABASE_URL: postgresql://dashtec:dashtec@${DB_HOST:-postgres-mainnet}:5432/dashtec
DATABASE_READ_REPLICA_URL: postgresql://dashtec:dashtec@${DB_HOST:-postgres-mainnet}:5432/dashtec
REDIS_URL: redis://:dashtec@${REDIS_HOST:-redis-mainnet}:6379
VALIDATOR_STATS_RPC_URL: ${VALIDATOR_STATS_RPC_URL}
depends_on:
aztec-node-mainnet:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
profiles:
- mainnet
materializer:
build:
context: .
dockerfile: packages/materializer/Dockerfile
image: dashtec-materializer:latest
container_name: dashtec-materializer
env_file:
- packages/materializer/.env.mainnet
environment:
DATABASE_URL: postgresql://dashtec:dashtec@${DB_HOST:-postgres-mainnet}:5432/dashtec
PONDER_SCHEMA: ponder_prod
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pgrep -x node || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
profiles:
- mainnet
# Testnet Web
web-testnet:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
NETWORK: testnet
image: dashtec-web:testnet
container_name: dashtec-web-testnet
ports:
- "${WEB_TESTNET_PORT:-3001}:3000"
env_file:
- apps/web/.env.testnet
environment:
DATABASE_URL: postgresql://dashtec:dashtec@postgres-testnet:5432/dashtec
REDIS_URL: redis://:dashtec@redis-testnet:6379
DATABASE_URL_REPLICA: postgresql://dashtec:dashtec@postgres-testnet:5432/dashtec
NEXT_SENTINEL_URL: ${NEXT_SENTINEL_URL_TESTNET}
depends_on:
aztec-node-testnet:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
profiles:
- testnet
# Testnet Indexer Ponder
indexer-ponder-testnet:
build:
context: .
dockerfile: packages/indexer-ponder/Dockerfile
image: dashtec-indexer-ponder:testnet
container_name: dashtec-indexer-ponder-testnet
ports:
- "${PONDER_TESTNET_PORT:-42070}:42069"
env_file:
- packages/indexer-ponder/.env.testnet
environment:
DATABASE_SCHEMA: ponder_prod
DATABASE_URL: postgresql://dashtec:dashtec@postgres-testnet:5432/dashtec
REDIS_URL: redis://:dashtec@redis-testnet:6379
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:42069/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
profiles:
- testnet
# Testnet Indexer Custom
indexer-custom-testnet:
build:
context: .
dockerfile: packages/indexer-custom/Dockerfile
image: dashtec-indexer-custom:testnet
container_name: dashtec-indexer-custom-testnet
ports:
- "${COLLECTOR_VALIDATOR_STATS_TESTNET_PORT:-4010}:4000"
- "${COLLECTOR_VALIDATOR_LIST_TESTNET_PORT:-4011}:4001"
- "${COLLECTOR_EPOCH_INTEGRITY_TESTNET_PORT:-4012}:4002"
- "${COLLECTOR_VALIDATOR_MIGRATION_TESTNET_PORT:-4013}:4003"
- "${COLLECTOR_PROVIDER_LIST_TESTNET_PORT:-4014}:4004"
env_file:
- packages/indexer-custom/.env.testnet
environment:
DATABASE_URL: postgresql://dashtec:dashtec@postgres-testnet:5432/dashtec
DATABASE_READ_REPLICA_URL: postgresql://dashtec:dashtec@postgres-testnet:5432/dashtec
REDIS_URL: redis://:dashtec@redis-testnet:6379
VALIDATOR_STATS_RPC_URL: ${VALIDATOR_STATS_RPC_URL_TESTNET}
depends_on:
aztec-node-testnet:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
profiles:
- testnet
# Testnet Materializer
materializer-testnet:
build:
context: .
dockerfile: packages/materializer/Dockerfile
image: dashtec-materializer:testnet
container_name: dashtec-materializer-testnet
env_file:
- packages/materializer/.env.testnet
environment:
DATABASE_URL: postgresql://dashtec:dashtec@postgres-testnet:5432/dashtec
PONDER_SCHEMA: ponder_prod
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pgrep -x node || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
profiles:
- testnet
# Aztec node (mainnet). Replaces the third-party sentinel proxy that
# NEXT_SENTINEL_URL / VALIDATOR_STATS_RPC_URL used to point at: a full node
# serves every node_* JSON-RPC method the dashboard needs, and SENTINEL_ENABLED
# is what makes node_getValidatorsStats available.
#
# `NETWORK: mainnet` makes the node resolve its own bootnodes, registry address
# and snapshot URLs from the published network config — no contract addresses
# are configured here. The RPC port is not published; sibling compose services
# reach it as http://aztec-node-mainnet:8080. P2P is published and must be
# opened in terraform/hetzner.tf.
aztec-node-mainnet:
image: ${AZTEC_NODE_IMAGE_MAINNET:-aztecprotocol/aztec:5.2.0@sha256:2dd0b84a5a42285762390e38f82a6ba737bfeba6e39df688af7f050dae81a3b0}
container_name: dashtec-aztec-node-mainnet
command: ["start", "--node"]
init: true
ports:
- "${AZTEC_NODE_P2P_PORT_MAINNET:-40400}:${AZTEC_NODE_P2P_PORT_MAINNET:-40400}/tcp"
- "${AZTEC_NODE_P2P_PORT_MAINNET:-40400}:${AZTEC_NODE_P2P_PORT_MAINNET:-40400}/udp"
environment:
NETWORK: mainnet
ETHEREUM_HOSTS: ${AZTEC_NODE_ETHEREUM_HOSTS_MAINNET}
L1_CONSENSUS_HOST_URLS: ${AZTEC_NODE_L1_CONSENSUS_HOSTS_MAINNET}
AZTEC_PORT: 8080
AZTEC_ADMIN_PORT: 8880
P2P_ENABLED: "true"
# Container and host port are kept equal so the ENR the node advertises
# matches what peers can actually dial through the published port.
P2P_PORT: ${AZTEC_NODE_P2P_PORT_MAINNET:-40400}
P2P_BROADCAST_PORT: ${AZTEC_NODE_P2P_PORT_MAINNET:-40400}
P2P_QUERY_FOR_IP: "true"
SENTINEL_ENABLED: "true"
SENTINEL_HISTORY_LENGTH_IN_EPOCHS: ${AZTEC_NODE_SENTINEL_EPOCHS_MAINNET:-24}
SYNC_MODE: ${AZTEC_NODE_SYNC_MODE_MAINNET:-snapshot}
# Whether the archiver may start against an L1 RPC that prunes historical
# logs. Off for mainnet (archival reth); on for testnet, where no free
# Sepolia endpoint both retains logs and survives startup. See docs/aztec-node.md.
ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK: ${AZTEC_NODE_SKIP_HISTORICAL_LOGS_CHECK_MAINNET:-false}
DATA_DIRECTORY: /data/data
CRS_PATH: /data/crs
NODE_OPTIONS: --no-warnings --max-old-space-size=${AZTEC_NODE_HEAP_MB_MAINNET:-4096}
LOG_LEVEL: info
LOG_JSON: 1
volumes:
- aztec_node_data_mainnet:/data/data
- aztec_node_crs_mainnet:/data/crs
restart: unless-stopped
stop_grace_period: 2m
healthcheck:
test:
- CMD
- node
- -e
- "fetch('http://127.0.0.1:8080/status').then(r => { if (!r.ok) throw new Error(String(r.status)); process.exit(0); }).catch(() => process.exit(1))"
interval: 15s
timeout: 10s
# A snapshot sync can take a long time on first boot; keep the container
# out of `unhealthy` until it has had a fair chance to catch up.
retries: 5
start_period: 30m
mem_limit: ${AZTEC_NODE_MEM_LIMIT_MAINNET:-8g}
logging:
driver: json-file
options:
max-size: 20m
max-file: "3"
profiles:
- mainnet
# Aztec node (testnet). Same shape as mainnet; a distinct P2P port so both can
# publish on the one host.
aztec-node-testnet:
image: ${AZTEC_NODE_IMAGE_TESTNET:-aztecprotocol/aztec:5.2.0@sha256:2dd0b84a5a42285762390e38f82a6ba737bfeba6e39df688af7f050dae81a3b0}
container_name: dashtec-aztec-node-testnet
command: ["start", "--node"]
init: true
ports:
- "${AZTEC_NODE_P2P_PORT_TESTNET:-40500}:${AZTEC_NODE_P2P_PORT_TESTNET:-40500}/tcp"
- "${AZTEC_NODE_P2P_PORT_TESTNET:-40500}:${AZTEC_NODE_P2P_PORT_TESTNET:-40500}/udp"
environment:
NETWORK: testnet
ETHEREUM_HOSTS: ${AZTEC_NODE_ETHEREUM_HOSTS_TESTNET}
L1_CONSENSUS_HOST_URLS: ${AZTEC_NODE_L1_CONSENSUS_HOSTS_TESTNET}
AZTEC_PORT: 8080
AZTEC_ADMIN_PORT: 8880
P2P_ENABLED: "true"
P2P_PORT: ${AZTEC_NODE_P2P_PORT_TESTNET:-40500}
P2P_BROADCAST_PORT: ${AZTEC_NODE_P2P_PORT_TESTNET:-40500}
P2P_QUERY_FOR_IP: "true"
SENTINEL_ENABLED: "true"
SENTINEL_HISTORY_LENGTH_IN_EPOCHS: ${AZTEC_NODE_SENTINEL_EPOCHS_TESTNET:-24}
SYNC_MODE: ${AZTEC_NODE_SYNC_MODE_TESTNET:-snapshot}
# Whether the archiver may start against an L1 RPC that prunes historical
# logs. Off for mainnet (archival reth); on for testnet, where no free
# Sepolia endpoint both retains logs and survives startup. See docs/aztec-node.md.
ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK: ${AZTEC_NODE_SKIP_HISTORICAL_LOGS_CHECK_TESTNET:-true}
DATA_DIRECTORY: /data/data
CRS_PATH: /data/crs
NODE_OPTIONS: --no-warnings --max-old-space-size=${AZTEC_NODE_HEAP_MB_TESTNET:-4096}
LOG_LEVEL: info
LOG_JSON: 1
volumes:
- aztec_node_data_testnet:/data/data
- aztec_node_crs_testnet:/data/crs
restart: unless-stopped
stop_grace_period: 2m
healthcheck:
test:
- CMD
- node
- -e
- "fetch('http://127.0.0.1:8080/status').then(r => { if (!r.ok) throw new Error(String(r.status)); process.exit(0); }).catch(() => process.exit(1))"
interval: 15s
timeout: 10s
retries: 5
start_period: 30m
mem_limit: ${AZTEC_NODE_MEM_LIMIT_TESTNET:-6g}
logging:
driver: json-file
options:
max-size: 20m
max-file: "3"
profiles:
- testnet
# Mainnet Database
postgres-mainnet:
image: postgres:16-alpine
container_name: dashtec-postgres-mainnet
ports:
- "${POSTGRES_MAINNET_PORT:-5432}:5432"
environment:
POSTGRES_USER: dashtec
POSTGRES_PASSWORD: dashtec
POSTGRES_DB: dashtec
volumes:
- postgres_data_mainnet:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dashtec"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- mainnet
# Testnet Database
postgres-testnet:
image: postgres:16-alpine
container_name: dashtec-postgres-testnet
ports:
- "${POSTGRES_TESTNET_PORT:-5433}:5432"
environment:
POSTGRES_USER: dashtec
POSTGRES_PASSWORD: dashtec
POSTGRES_DB: dashtec
volumes:
- postgres_data_testnet:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dashtec"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- testnet
# Mainnet Redis
redis-mainnet:
image: redis:7-alpine
container_name: dashtec-redis-mainnet
command: redis-server --requirepass ${REDIS_PASSWORD:-dashtec}
ports:
- "${REDIS_MAINNET_PORT:-6379}:6379"
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-dashtec}
volumes:
- redis_data_mainnet:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-dashtec}", "ping"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- mainnet
# Testnet Redis
redis-testnet:
image: redis:7-alpine
container_name: dashtec-redis-testnet
command: redis-server --requirepass ${REDIS_PASSWORD:-dashtec}
ports:
- "${REDIS_TESTNET_PORT:-6380}:6379"
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-dashtec}
volumes:
- redis_data_testnet:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-dashtec}", "ping"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- testnet
# Name the implicit default network so it is addressable from outside compose.
# The deploy runs contract discovery in a throwaway `node:20-alpine` container
# that has to reach http://aztec-node-<network>:8080, and `docker run --network
# dashtec` only works if the name is fixed rather than derived from the project
# directory. No service opts in explicitly — this renames the network they all
# already share.
networks:
default:
name: dashtec
volumes:
postgres_data_mainnet:
postgres_data_testnet:
redis_data_mainnet:
redis_data_testnet:
# Aztec node world state + archiver data, and the (large, immutable) CRS. Kept
# as named volumes so a `docker compose down` does not force a resync.
aztec_node_data_mainnet:
aztec_node_crs_mainnet:
aztec_node_data_testnet:
aztec_node_crs_testnet: