forked from EYBlockchain/nightfall_3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
370 lines (357 loc) · 8.98 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
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
version: '3.5'
# Use this script for running up nightfall_3 in 'developer' mode with local
# bindings. See the readme for more information.
services:
client1:
build:
dockerfile: Dockerfile
context: ./nightfall-client
volumes:
- type: bind
source: ./nightfall-client/src
target: /app/src
- type: bind
source: ./common-files
target: /common-files
- type: bind
source: ./config/default.js
target: /app/config/default.js
- type: volume
source: build
target: /app/build
- type: volume
source: mongodb1
target: /app/mongodb
networks:
- nightfall_network
ports:
- 27017:27017
- 8080:80
depends_on:
- deployer
- worker
- timber1
- rabbitmq1
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
LOG_LEVEL: debug
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
ZOKRATES_WORKER_HOST: worker
RABBITMQ_HOST: amqp://rabbitmq1
RABBITMQ_PORT: 5672
TIMBER_HOST: timber1
TIMBER_PORT: 80
ENABLE_QUEUE: 1
OPTIMIST_HOST: optimist1
OPTIMIST_PORT: 80
USE_STUBS: 'false' # make sure this flag is the same as in deployer service
command: ['npm', 'run', 'dev']
client2:
build:
dockerfile: Dockerfile
context: ./nightfall-client
volumes:
- type: bind
source: ./nightfall-client/src
target: /app/src
- type: bind
source: ./common-files
target: /common-files
- type: bind
source: ./config/default.js
target: /app/config/default.js
- type: volume
source: build
target: /app/build
- type: volume
source: mongodb2
target: /app/mongodb
networks:
- nightfall_network
ports:
- 27018:27017
- 8084:80
depends_on:
- deployer
- worker
- timber2
- rabbitmq2
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
LOG_LEVEL: debug
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
ZOKRATES_WORKER_HOST: worker
RABBITMQ_HOST: amqp://rabbitmq2
RABBITMQ_PORT: 5672
TIMBER_HOST: timber2
TIMBER_PORT: 80
ENABLE_QUEUE: 1
OPTIMIST_HOST: optimist2
OPTIMIST_PORT: 80
USE_STUBS: 'false' # make sure this flag is the same as in deployer service
command: ['npm', 'run', 'dev']
worker:
# image: 3800decac71d
build:
dockerfile: Dockerfile
context: ./zokrates-worker
volumes:
- type: volume
source: proving_files
target: /app/output/
- type: bind
source: ./nightfall-deployer/circuits
target: /app/circuits/
- type: bind
source: ./zokrates-worker/src
target: /app/src/
- type: bind
source: ./config/default.js
target: /app/config/default.js
depends_on:
- deployer
networks:
- nightfall_network
environment:
LOG_LEVEL: info
# Temporary container to deploy contracts and circuits and populate volumes
deployer:
#image: docker.pkg.github.com/eyblockchain/nightfall-deployer/nightfall_deployer:1.1.0
build:
context: ./nightfall-deployer
dockerfile: Dockerfile
volumes:
- type: volume
source: build
target: /app/build/
- type: bind
source: ./nightfall-deployer/contracts
target: /app/contracts/
- type: bind
source: ./nightfall-deployer/circuits
target: /app/circuits/
- type: bind
source: ./nightfall-deployer/src
target: /app/src/
- type: bind
source: ./common-files
target: /common-files
- type: bind
source: ./config/default.js
target: /app/config/default.js
- type: bind
source: ./nightfall-deployer/migrations
target: /app/migrations
- type: bind
source: ./nightfall-deployer/truffle-config.js
target: /app/truffle-config.js
- type: bind
source: ./nightfall-deployer/entrypoint.sh
target: /app/entrypoint.sh
networks:
- nightfall_network
environment:
LOG_LEVEL: debug
# ETH_NETWORK sets the network selected by Truffle from truffle-config.js
# startup routines will wait for a blockchain client to be reachable on this network
ETH_NETWORK: blockchain1
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
ZOKRATES_WORKER_HOST: worker
# TIMBER_HOST: timber1
# TIMBER_PORT: 80
USE_STUBS: 'false'
# Timber service, configured for nightfall
timber1:
build:
dockerfile: Dockerfile
context: ./timber
restart: on-failure
depends_on:
- deployer
- timber-database1
networks:
- nightfall_network
ports:
- 8083:80
volumes:
- type: volume
source: build
target: /app/build/
- type: bind
source: ./timber/src
target: /app/src/
- type: bind
source: ./config/timber.js
target: /app/config/default.js
- type: bind
source: ./timber/entrypoint.sh
target: /app/entrypoint.sh
environment:
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
MONGO_HOST: timber-database1
MONGO_PORT: 27017
MONGO_NAME: merkle_tree
HASH_TYPE: mimc
LOG_LEVEL: info
AUTOSTART: enabled
# Timber service, configured for nightfall
timber2:
build:
dockerfile: Dockerfile
context: ./timber
restart: on-failure
depends_on:
- deployer
- timber-database2
networks:
- nightfall_network
ports:
- 8087:80
volumes:
- type: volume
source: build
target: /app/build/
- type: bind
source: ./timber/src
target: /app/src/
- type: bind
source: ./config/timber.js
target: /app/config/default.js
environment:
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
MONGO_HOST: timber-database2
MONGO_PORT: 27017
MONGO_NAME: merkle_tree
HASH_TYPE: mimc
LOG_LEVEL: info
AUTOSTART: enabled
#The database storing the merkle tree
timber-database1:
image: mongo
environment:
- MONGO_INITDB_DATABASE=merkle_tree
volumes:
- type: volume
source: timber-database-volume1
target: /data/db
networks:
- nightfall_network
#The database storing the merkle tree
timber-database2:
image: mongo
environment:
- MONGO_INITDB_DATABASE=merkle_tree
volumes:
- type: volume
source: timber-database-volume2
target: /data/db
networks:
- nightfall_network
rabbitmq1:
image: rabbitmq
ports:
- '15674:15674'
- '5672:5672'
networks:
- nightfall_network
rabbitmq2:
image: rabbitmq
ports:
- '15675:15674'
- '5673:5672'
networks:
- nightfall_network
optimist1:
build:
context: ./nightfall-optimist
depends_on:
- timber1
- deployer
networks:
- nightfall_network
ports:
- 8081:80
# websocket port for Optimist is on localhost:8082
- 8082:8080
volumes:
- type: volume
source: build
target: /app/build/
- type: bind
source: ./nightfall-optimist/src
target: /app/src
- type: bind
source: ./common-files
target: /common-files
- type: bind
source: ./config/default.js
target: /app/config/default.js
environment:
WEBSOCKET_PORT: 8080
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
HASH_TYPE: mimc
LOG_LEVEL: debug
IS_CHALLENGER: 'true'
TRANSACTIONS_PER_BLOCK: 2
TIMBER_HOST: timber1
TIMBER_PORT: 80
command: ['npm', 'run', 'dev']
optimist2:
build:
context: ./nightfall-optimist
depends_on:
- timber2
- deployer
networks:
- nightfall_network
ports:
- 8085:80
# websocket port for Optimist is on localhost:8086
- 8086:8080
volumes:
- type: volume
source: build
target: /app/build/
- type: bind
source: ./nightfall-optimist/src
target: /app/src
- type: bind
source: ./common-files
target: /common-files
- type: bind
source: ./config/default.js
target: /app/config/default.js
environment:
WEBSOCKET_PORT: 8084
BLOCKCHAIN_WS_HOST: blockchain1
BLOCKCHAIN_PORT: 8546
HASH_TYPE: mimc
LOG_LEVEL: debug
IS_CHALLENGER: 'true'
TRANSACTIONS_PER_BLOCK: 2
TIMBER_HOST: timber2
TIMBER_PORT: 80
command: ['npm', 'run', 'dev']
volumes:
mongodb1:
mongodb2:
proving_files:
build:
timber-database-volume1:
timber-database-volume2:
networks:
nightfall_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1