-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
198 lines (192 loc) · 7.8 KB
/
Copy pathdocker-compose.yml
File metadata and controls
198 lines (192 loc) · 7.8 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
# =============================================================================
# warp-toad services - unified docker compose
#
# Runs both bridge-sync (BridgeKeeper) and relay-service on a shared
# `warptoad-network` so they can be co-located on a single host (and talk to
# each other in the future if we ever need to).
#
# Each service still has its own per-workspace docker-compose.yml that you can
# use to run them independently.
#
# Usage:
# docker compose up -d # build + run both in background
# docker compose logs -f # tail both
# docker compose logs -f bridge-sync
# docker compose down # stop both, leave images
#
# Required env (in this dir, ./.env at the repo root):
#
# # bridge-sync
# EVM_PRIVATE_KEY=0x... # signs L1 root-update txs
# SEPOLIA_RPC_URL=https://...
# ZKSYNC_ERA_SEPOLIA_RPC_URL=https://sepolia.era.zksync.dev # optional
# AZTEC_NODE_URL=https://v5.testnet.rpc.aztec-labs.com
#
# # relay-service
# RELAYER_PRIVATE_KEY=0x... # signs mint() relay txs
# L1_RPC_URL=https://... # same Sepolia RPC; relay-service uses
# # a different var name than bridge-sync
# # for historical reasons
# # ZKSYNC_ERA_SEPOLIA_RPC_URL is reused from bridge-sync section above
#
# # both
# ALLOWED_ORIGINS=https://your.frontend,https://other.frontend
#
# The two private keys can be the SAME wallet, but it's safer to use a
# different one for each so the relayer's mempool nonce isn't fighting with
# the keeper's.
# =============================================================================
services:
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
# Vite bakes VITE_* env vars at BUILD time, not runtime. To reconfigure
# any of these, you must rebuild the image (`docker compose build frontend`).
args:
VITE_TEST_MODE: ${VITE_TEST_MODE:-false}
VITE_SEPOLIA_RPC_URL: ${VITE_SEPOLIA_RPC_URL:-${SEPOLIA_RPC_URL}}
VITE_ZKSYNC_ERA_SEPOLIA_RPC_URL: ${VITE_ZKSYNC_ERA_SEPOLIA_RPC_URL:-${ZKSYNC_ERA_SEPOLIA_RPC_URL:-https://sepolia.era.zksync.dev}}
VITE_AZTEC_NODE_URL: ${VITE_AZTEC_NODE_URL:-${AZTEC_NODE_URL}}
VITE_LOCAL_AZTEC_NODE_URL: ${VITE_LOCAL_AZTEC_NODE_URL:-http://localhost:8080}
# The frontend bundle runs in the user's BROWSER, so these URLs must
# be reachable from the browser - they go through the host port
# mappings (127.0.0.1:6969 / 127.0.0.1:7777), not Docker's internal
# service-name DNS.
VITE_BRIDGE_KEEPER_URL: ${VITE_BRIDGE_KEEPER_URL:-http://localhost:6969}
VITE_RELAY_SERVICE_URL: ${VITE_RELAY_SERVICE_URL:-http://localhost:7777}
VITE_FAUCET_SERVICE_URL: ${VITE_FAUCET_SERVICE_URL:-http://localhost:8888}
# Optional umami analytics. Both must be set or the script is not
# injected (unset = no-op, no 404 noise).
VITE_UMAMI_SCRIPT_URL: ${VITE_UMAMI_SCRIPT_URL:-}
VITE_UMAMI_WEBSITE_ID: ${VITE_UMAMI_WEBSITE_ID:-}
image: warptoad/frontend:latest
container_name: warptoad-frontend
ports:
- "127.0.0.1:4173:4173"
restart: unless-stopped
networks:
- warptoad-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:4173/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
depends_on:
- bridge-sync
- relay-service
- faucet-service
bridge-sync:
build:
context: .
dockerfile: bridge-sync/Dockerfile
image: warptoad/bridge-sync:latest
container_name: warptoad-bridge-sync
ports:
- "127.0.0.1:6969:6969"
environment:
NODE_ENV: production
PORT: 6969
EVM_PRIVATE_KEY: ${EVM_PRIVATE_KEY}
# Keeper RPCs. Each accepts a comma-separated list; with more than one the
# keeper uses a viem fallback() transport and moves to the next provider
# when the current one errors.
SEPOLIA_RPC_URL: ${SEPOLIA_RPC_URL}
ZKSYNC_ERA_SEPOLIA_RPC_URL: ${ZKSYNC_ERA_SEPOLIA_RPC_URL:-https://sepolia.era.zksync.dev}
AZTEC_NODE_URL: ${AZTEC_NODE_URL}
# Browser-facing /rpc/:chain upstreams. Prefix any RPC var with PROXY_ to
# give user traffic its own key, so a frontend event-scan storm can't
# rate-limit the keeper out of its own provider. Unset = share the
# keeper's URL (previous behaviour).
PROXY_SEPOLIA_RPC_URL: ${PROXY_SEPOLIA_RPC_URL:-}
PROXY_ZKSYNC_ERA_SEPOLIA_RPC_URL: ${PROXY_ZKSYNC_ERA_SEPOLIA_RPC_URL:-}
# Response timeout for every keeper RPC. Default 60s: ZKsync Era's
# eth_estimateGas for sentLocalRootToL1() takes ~21s, and viem's built-in
# default of 10s silently killed every Era local-root push.
RPC_TIMEOUT_MS: ${RPC_TIMEOUT_MS:-60000}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-}
DEFAULT_CONFIRMATIONS: ${DEFAULT_CONFIRMATIONS:-3}
AZTEC_HEARTBEAT_ENABLED: ${AZTEC_HEARTBEAT_ENABLED:-true}
AZTEC_HEARTBEAT_CHECK_INTERVAL_MS: ${AZTEC_HEARTBEAT_CHECK_INTERVAL_MS:-300000}
AZTEC_HEARTBEAT_THRESHOLD_BLOCKS: ${AZTEC_HEARTBEAT_THRESHOLD_BLOCKS:-80}
AZTEC_HEARTBEAT_RETENTION_BLOCKS: ${AZTEC_HEARTBEAT_RETENTION_BLOCKS:-100}
# Unified scheduler (subsumes per-route triggering + aztecHeartbeat).
# Default false during the rollout; set to true to flip the cutover.
# Watch /health.scheduler before flipping back.
BRIDGE_SYNC_USE_UNIFIED_SCHEDULER: ${BRIDGE_SYNC_USE_UNIFIED_SCHEDULER:-false}
BRIDGE_SYNC_COALESCE_WINDOW_MS: ${BRIDGE_SYNC_COALESCE_WINDOW_MS:-90000}
volumes:
- bridge-sync-logs:/app/bridge-sync/logs
- bridge-sync-db:/app/bridge-sync/db
restart: unless-stopped
networks:
- warptoad-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:6969/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
relay-service:
build:
context: .
dockerfile: relay-service/Dockerfile
image: warptoad/relay-service:latest
container_name: warptoad-relay-service
ports:
- "127.0.0.1:7777:7777"
environment:
NODE_ENV: production
PORT: 7777
RELAYER_PRIVATE_KEY: ${RELAYER_PRIVATE_KEY}
L1_RPC_URL: ${L1_RPC_URL:-${SEPOLIA_RPC_URL}}
ZKSYNC_ERA_SEPOLIA_RPC_URL: ${ZKSYNC_ERA_SEPOLIA_RPC_URL:-https://sepolia.era.zksync.dev}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-}
MIN_FEE_FACTOR: ${MIN_FEE_FACTOR:-0}
MAX_FEE_FACTOR: ${MAX_FEE_FACTOR:-0}
MIN_PROFIT_USD: ${MIN_PROFIT_USD:-0}
restart: unless-stopped
networks:
- warptoad-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:7777/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
faucet-service:
build:
context: .
dockerfile: faucet-service/Dockerfile
image: warptoad/faucet-service:latest
container_name: warptoad-faucet-service
ports:
- "127.0.0.1:8888:8888"
environment:
NODE_ENV: production
PORT: 8888
FAUCET_PRIVATE_KEY: ${FAUCET_PRIVATE_KEY}
SEPOLIA_RPC_URL: ${SEPOLIA_RPC_URL}
ZKSYNC_ERA_SEPOLIA_RPC_URL: ${ZKSYNC_ERA_SEPOLIA_RPC_URL:-https://sepolia.era.zksync.dev}
FAUCET_DRIP_AMOUNT_ETH: ${FAUCET_DRIP_AMOUNT_ETH:-0.05}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-}
volumes:
- faucet-db:/app/faucet-service/db
restart: unless-stopped
networks:
- warptoad-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8888/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
volumes:
bridge-sync-logs:
bridge-sync-db:
faucet-db:
networks:
warptoad-network:
name: warptoad-network
driver: bridge