-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
238 lines (221 loc) · 6.61 KB
/
docker-compose.yml
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
version: "3.7"
networks:
simulation:
driver: bridge
ipam:
driver: default
config:
- subnet: "10.2.0.0/24"
services:
# Accounts are hardcoded to 520 with the idea that nwaku nodes use up to 500 for membership registration and the last 20 are used for ad-hoc testing.
# The account number and private key pairs of the last 20 accounts can be found in the Register memberships section of the Waku-simulator book.
foundry:
image: ghcr.io/foundry-rs/foundry:nightly-9b73e06e1fe376738b92ae081107620291d50188
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
ports:
- 0.0.0.0:8545:8545
command:
- anvil
--port=8545
--host=0.0.0.0
--accounts=520
--allow-origin=*
--block-time=12
--chain-id=1234
--silent
--config-out=/shared/anvil-config.txt
volumes:
- privatekeys-volume:/shared
networks:
- simulation
contract-repo-deployer:
image: node:hydrogen-bullseye
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
environment:
- RLN_CONTRACT_REPO_COMMIT=${RLN_CONTRACT_REPO_COMMIT:-64df4593c6a14e43b8b0e9b396d2f4772bb08b34}
- PRIVATE_KEY=${PRIVATE_KEY}
- RPC_URL=${RPC_URL:-http://foundry:8545}
- ETH_FROM=${ETH_FROM}
- MAX_MESSAGE_LIMIT=${MAX_MESSAGE_LIMIT:-20}
entrypoint: sh
command:
- '/opt/deploy_rln_contract.sh'
volumes:
- ./deploy_rln_contract.sh:/opt/deploy_rln_contract.sh
depends_on:
- foundry
networks:
- simulation
bootstrap:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
restart: on-failure
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# TODO: expose some ports to inject traffic
ports:
- 127.0.0.1:60000:60000
- 127.0.0.1:8008:8008
- 127.0.0.1:9000:9000
- 127.0.0.1:8645:8645
entrypoint: sh
command:
- '/opt/run_bootstrap.sh'
volumes:
- ./run_bootstrap.sh:/opt/run_bootstrap.sh:Z
networks:
- simulation
nwaku:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
restart: on-failure
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
deploy:
replicas: ${NUM_NWAKU_NODES:-5}
entrypoint: sh
environment:
- RPC_URL=${RPC_URL:-http://foundry:8545}
- RLN_CONTRACT_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
- RLN_CREDENTIAL_PATH=/keystore.json
- RLN_CREDENTIAL_PASSWORD=passw123
- RLN_RELAY_MSG_LIMIT=${RLN_RELAY_MSG_LIMIT:-10}
- RLN_RELAY_EPOCH_SEC=${RLN_RELAY_EPOCH_SEC:-60}
command:
- '/opt/run_nwaku.sh'
volumes:
- ./run_nwaku.sh:/opt/run_nwaku.sh:Z
- privatekeys-volume:/shared
depends_on:
contract-repo-deployer:
condition: service_completed_successfully
networks:
- simulation
rest-traffic:
image: alrevuelta/rest-traffic:28430f8
command:
--multiple-nodes=http://waku-simulator-nwaku-[1..${NUM_NWAKU_NODES:-5}]:8645
--msg-size-kbytes=${MSG_SIZE_KBYTES:-10}
--delay-seconds=${TRAFFIC_DELAY_SECONDS:-15}
networks:
- simulation
depends_on:
- nwaku
prometheus:
image: prom/prometheus:latest
volumes:
- ./monitoring/prometheus-config.yml:/etc/prometheus/prometheus.yml:z
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.retention.time=7d
ports:
- 127.0.0.1:9090:9090
restart: on-failure
networks:
- simulation
grafana:
image: grafana/grafana:latest
env_file:
- ./monitoring/configuration/grafana-plugins.env
environment:
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
volumes:
- ./monitoring/configuration/grafana.ini:/etc/grafana/grafana.ini:z
- ./monitoring/configuration/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:z
- ./monitoring/configuration/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml:z
- ./monitoring/configuration/dashboards:/var/lib/grafana/dashboards/:z
- ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_icon.svg:z
- ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_typelogo.svg:z
- ./monitoring/configuration/customizations/custom-logo.png:/usr/share/grafana/public/img/fav32.png:z
ports:
- 0.0.0.0:3001:3001
restart: on-failure
depends_on:
- prometheus
networks:
- simulation
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
#ports:
# - 8080:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
depends_on:
- redis
networks:
- simulation
redis:
image: redis:latest
container_name: redis
#ports:
# - 6379:6379
networks:
- simulation
api:
image: web3labs/epirus-free-api:latest
ports:
- 127.0.0.1:8090:8090
environment:
- NODE_ENDPOINT=${RPC_URL:-http://foundry:8545}
- MONGO_CLIENT_URI=mongodb://mongodb:27017
- REINDEX_ENDPOINT=http://ingestion/reindex/
- MONGO_DB_NAME=epirus
- MONGO_CREATE_INDICES=true
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
- mongodb
- foundry
networks:
- simulation
mongodb:
image: mongo:5.0.8
environment:
- COMPOSE_HTTP_TIMEOUT=900
- DOCKER_CLIENT_TIMEOUT=900
entrypoint: mongod --bind_ip "0.0.0.0"
networks:
- simulation
web:
image: web3labs/epirus-free-web:latest
environment:
- API_URL=${EPIRUS_WEB_API_URL:-/api}
- WS_API_URL=${EPIRUS_WEB_WS_API_URL:-ws://localhost:8090}
- DISPLAY_NETWORK_TAB=disabled
depends_on:
- api
networks:
- simulation
ingestion:
image: web3labs/epirus-free-ingestion:latest
environment:
- NODE_ENDPOINT=${RPC_URL:-http://foundry:8545}
- MONGO_CLIENT_URI=mongodb://mongodb:27017
- MONGO_DB_NAME=epirus
- LIST_OF_METRICS_TO_CALCULATE_PER_MINUTE=hourly,daily,monthly,yearly
depends_on:
- mongodb
- redis
- foundry
networks:
- simulation
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./5xx.html:/www/error_pages/5xx.html
ports:
- 0.0.0.0:3000:80
depends_on:
- api
- web
networks:
- simulation
volumes:
privatekeys-volume: