This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
forked from AudiusProject/audius-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
459 lines (415 loc) · 14.8 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
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
version: "3.9"
x-logging:
&default-logging
options:
max-size: "50m"
max-file: "3"
driver: json-file
services:
# contracts
poa-ganache:
build:
context: contracts
dockerfile: Dockerfile.dev
args:
bootstrapSPIds: ${BOOTSTRAP_SP_IDS}
bootstrapSPDelegateWallets: ${BOOTSTRAP_SP_DELEGATE_WALLETS}
bootstrapSPOwnerWallets: ${BOOTSTRAP_SP_OWNER_WALLETS}
command: bash /tmp/dev-tools/startup/poa-ganache.sh
volumes:
- poa-contracts-abis:/usr/src/app/build/contracts
- ./dev-tools:/tmp/dev-tools
ports:
- "8545:8545"
logging: *default-logging
deploy:
mode: global
poa-blockscout-db:
image: postgres:13.6
environment:
POSTGRES_PASSWORD: "postgres"
POSTGRES_USER: "postgres"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
logging: *default-logging
deploy:
mode: global
profiles:
- block-explorer
poa-blockscout:
image: blockscout/blockscout:4.1.3
command: "mix do ecto.create, ecto.migrate, phx.server"
environment:
ETHEREUM_JSONRPC_VARIANT: "ganache"
ETHEREUM_JSONRPC_HTTP_URL: "http://poa-ganache:8545"
ETHEREUM_JSONRPC_WS_URL: "ws://poa-ganache:8545"
INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER: "true"
DATABASE_URL: "postgresql://postgres:postgres@poa-blockscout-db:5432/postgres?ssl=false"
ECTO_USE_SSL: false
ports:
- "9545:4000"
depends_on:
poa-blockscout-db:
condition: service_healthy
poa-ganache:
condition: service_healthy
logging: *default-logging
deploy:
mode: global
profiles:
- block-explorer
# eth-contracts
eth-ganache:
build:
context: eth-contracts
dockerfile: Dockerfile.dev
args:
CONTENT_NODE_VERSION: ${CONTENT_NODE_VERSION}
DISCOVERY_NODE_VERSION: ${DISCOVERY_NODE_VERSION}
antiAbuseOracleAddresses: "${AAO_WALLET_ADDRESSES}"
command: bash /tmp/dev-tools/startup/eth-ganache.sh
volumes:
- eth-contracts-abis:/usr/src/app/build/contracts
- ./dev-tools:/tmp/dev-tools
ports:
- "8546:8545"
logging: *default-logging
deploy:
mode: global
eth-blockscout-db:
image: postgres:13.6
environment:
POSTGRES_PASSWORD: "postgres"
POSTGRES_USER: "postgres"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
logging: *default-logging
deploy:
mode: global
profiles:
- block-explorer
eth-blockscout:
image: blockscout/blockscout:4.1.3
command: "mix do ecto.create, ecto.migrate, phx.server"
environment:
ETHEREUM_JSONRPC_VARIANT: "ganache"
ETHEREUM_JSONRPC_HTTP_URL: "http://eth-ganache:8545"
ETHEREUM_JSONRPC_WS_URL: "ws://eth-ganache:8545"
INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER: "true"
DATABASE_URL: "postgresql://postgres:postgres@eth-blockscout-db:5432/postgres?ssl=false"
ECTO_USE_SSL: false
ports:
- "9546:4000"
depends_on:
eth-blockscout-db:
condition: service_healthy
eth-ganache:
condition: service_healthy
logging: *default-logging
deploy:
mode: global
profiles:
- block-explorer
# solana-programs
solana-test-validator:
image: audius/solana-programs:latest
# NOTE: Building solana program can take a lot of time especially on m1 (upto 30 mins) so we used pre-built images
# build:
# context: solana-programs
# dockerfile: Dockerfile.dev
# args:
# AUDIUS_ETH_REGISTRY_PRIVATE_KEY: "${SOLANA_AUDIUS_ETH_REGISTRY_SECRET_KEY}"
# TRACK_LISTEN_COUNT_PRIVATE_KEY: "${SOLANA_TRACK_LISTEN_COUNT_SECRET_KEY}"
# CLAIMABLE_TOKENS_PRIVATE_KEY: "${SOLANA_CLAIMABLE_TOKENS_SECRET_KEY}"
# REWARD_MANAGER_PRIVATE_KEY: "${SOLANA_REWARD_MANAGER_SECRET_KEY}"
# AUDIUS_DATA_PRIVATE_KEY: "${SOLANA_AUDIUS_DATA_SECRET_KEY}"
# owner_private_key: "${SOLANA_OWNER_SECRET_KEY}"
# feepayer_private_key: "${SOLANA_FEEPAYER_SECRET_KEY}"
# token_private_key: "${SOLANA_TOKEN_MINT_SECRET_KEY}"
# admin_authority_private_key: "${SOLANA_ADMIN_AUTHORITY_SECRET_KEY}"
# admin_account_private_key: "${SOLANA_ADMIN_ACCOUNT_SECRET_KEY}"
# signer_group_private_key: "${SOLANA_SIGNER_GROUP_SECRET_KEY}"
# valid_signer_private_key: "${SOLANA_VALID_SIGNER_SECRET_KEY}"
# reward_manager_pda_private_key: "${SOLANA_REWARD_MANAGER_PDA_SECRET_KEY}"
# reward_manager_token_pda_private_key: "${SOLANA_REWARD_MANAGER_TOKEN_PDA_SECRET_KEY}"
# valid_signer_eth_address: "${ETH_VALID_SIGNER_ADDRESS}"
volumes:
- solana-programs-idl:/usr/src/app/anchor/audius-data/idl
ports:
- "8899:8899"
logging: *default-logging
deploy:
mode: global
# build libs
build-audius-libs:
build: libs
command: sh /tmp/dev-tools/startup/build-audius-libs.sh
volumes:
- audius-libs:/usr/src/app
- poa-contracts-abis:/usr/src/data-contracts/ABIs
- eth-contracts-abis:/usr/src/eth-contracts/ABIs
- ./libs/src:/usr/src/app/src
- ./dev-tools:/tmp/dev-tools
depends_on:
poa-ganache:
condition: service_started
eth-ganache:
condition: service_started
logging: *default-logging
deploy:
mode: global
# audius-cmd
audius-cmd:
build: dev-tools/commands
command: sleep infinity
environment:
ETH_TOKEN_ADDRESS: "${ETH_TOKEN_ADDRESS}"
ETH_REGISTRY_ADDRESS: "${ETH_REGISTRY_ADDRESS}"
ETH_PROVIDER_URL: "http://eth-ganache:8545"
ETH_OWNER_WALLET: "${ETH_OWNER_WALLET}"
POA_REGISTRY_ADDRESS: "${POA_REGISTRY_ADDRESS}"
ENTITY_MANAGER_ADDRESS: "${ENTITY_MANAGER_ADDRESS}"
POA_PROVIDER_URL: "http://poa-ganache:8545"
SOLANA_ENDPOINT: "http://solana-test-validator:8899"
SOLANA_OWNER_SECRET_KEY: "${SOLANA_OWNER_SECRET_KEY}"
SOLANA_TOKEN_MINT_PUBLIC_KEY: "${SOLANA_TOKEN_MINT_PUBLIC_KEY}"
SOLANA_CLAIMABLE_TOKENS_PUBLIC_KEY: "${SOLANA_CLAIMABLE_TOKENS_PUBLIC_KEY}"
SOLANA_REWARD_MANAGER_PUBLIC_KEY: "${SOLANA_REWARD_MANAGER_PUBLIC_KEY}"
SOLANA_REWARD_MANAGER_PDA_PUBLIC_KEY: "${SOLANA_REWARD_MANAGER_PDA_PUBLIC_KEY}"
SOLANA_REWARD_MANAGER_TOKEN_PDA_PUBLIC_KEY: "${SOLANA_REWARD_MANAGER_TOKEN_PDA_PUBLIC_KEY}"
SOLANA_FEEPAYER_SECRET_KEY: "${SOLANA_FEEPAYER_SECRET_KEY}"
IDENTITY_SERVICE_URL: "http://identity-service:7000"
FALLBACK_CREATOR_NODE_URL: "http://creator-node:4000" # this should choose a random cn everytime this is run
volumes:
- audius-libs:/usr/src/app/node_modules/@audius/sdk
- ./dev-tools/commands/src:/usr/src/app/src
- ./dev-tools/commands/test:/usr/src/app/test
depends_on:
build-audius-libs:
condition: service_started
logging: *default-logging
deploy:
mode: global
# identity-service
identity-service-db:
image: postgres:11.4
user: postgres
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
logging: *default-logging
deploy:
mode: global
identity-service-redis:
image: redis:7.0
command: redis-server
healthcheck:
test: [ "CMD", "redis-cli", "PING" ]
interval: 10s
timeout: 5s
logging: *default-logging
deploy:
mode: global
identity-service:
build:
context: identity-service
args:
git_sha: "${GIT_COMMIT}"
command: sh -c ". /tmp/dev-tools/startup/identity-service.sh && scripts/dev-server.sh"
ports:
- "7000:7000"
- "9229:9229"
environment:
logLevel: debug
minimumBalance: 1
minimumRelayerBalance: 1
minimumFunderBalance: 1
relayerPrivateKey: "${POA_RELAYER_WALLET_1_PRIVATE_KEY}"
relayerPublicKey: "${POA_RELAYER_WALLET_1_ADDRESS}"
relayerWallets: "${POA_RELAYER_WALLETS}"
ethFunderAddress: "0xaaaa90Fc2bfa70028D6b444BB9754066d9E2703b"
ethRelayerWallets: "${ETH_RELAYER_WALLETS}"
userVerifierPrivateKey: "ebba299e6163ff3208de4e82ce7db09cf7e434847b5bdab723af96ae7c763a0e"
userVerifierPublicKey: "0xbbbb93A6B3A1D6fDd27909729b95CCB0cc9002C0'"
dbUrl: "postgres://postgres:postgres@identity-service-db:5432/postgres"
redisHost: "identity-service-redis"
redisPort: 6379
aaoEndpoint: "http://anti-abuse-oracle:8000"
aaoAddress: "${AAO_WALLET_ADDRESS}"
web3Provider: "http://poa-ganache:8545"
secondaryWeb3Provider: "http://poa-ganache:8545"
registryAddress: "${POA_REGISTRY_ADDRESS}"
entityManagerAddress: "${ENTITY_MANAGER_ADDRESS}"
ownerWallet: "${POA_OWNER_WALLET}"
ethProviderUrl: "http://eth-ganache:8545"
ethTokenAddress: "${ETH_TOKEN_ADDRESS}"
ethRegistryAddress: "${ETH_REGISTRY_ADDRESS}"
ethOwnerWallet: "${ETH_OWNER_WALLET}"
solanaEndpoint: "http://solana-test-validator:8899"
solanaTrackListenCountAddress: "${SOLANA_TRACK_LISTEN_COUNT_PUBLIC_KEY}"
solanaAudiusEthRegistryAddress: "${SOLANA_AUDIUS_ETH_REGISTRY_PUBLIC_KEY}"
solanaValidSigner: "${SOLANA_VALID_SIGNER_PUBLIC_KEY}"
solanaFeePayerWallets: '[{"privateKey":${SOLANA_FEEPAYER_SECRET_KEY}}]'
solanaSignerPrivateKey: "${ETH_VALID_SIGNER_PRIVATE_KEY}"
solanaMintAddress: "${SOLANA_TOKEN_MINT_PUBLIC_KEY}"
solanaClaimableTokenProgramAddress: "${SOLANA_CLAIMABLE_TOKENS_PUBLIC_KEY}"
solanaRewardsManagerProgramId: "${SOLANA_REWARD_MANAGER_PUBLIC_KEY}"
solanaRewardsManagerProgramPDA: "${SOLANA_REWARD_MANAGER_PDA_PUBLIC_KEY}"
solanaRewardsManagerTokenPDA: "${SOLANA_REWARD_MANAGER_TOKEN_PDA_PUBLIC_KEY}"
solanaAudiusAnchorDataProgramId: "${SOLANA_AUDIUS_DATA_PUBLIC_KEY}"
volumes:
- ./identity-service:/usr/src/app
- /usr/src/app/node_modules
- ./dev-tools:/tmp/dev-tools
- audius-libs:/usr/src/audius-libs
- /usr/src/app/build
depends_on:
identity-service-db:
condition: service_healthy
identity-service-redis:
condition: service_healthy
poa-ganache:
condition: service_healthy
eth-ganache:
condition: service_healthy
solana-test-validator:
condition: service_healthy
build-audius-libs:
condition: service_started
logging: *default-logging
deploy:
mode: global
# discovery-provider
discovery-provider-elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.1.0
environment:
discovery.type: single-node
xpack.security.enabled: false
ES_JAVA_OPTS: -Xms512m -Xmx512m
healthcheck:
test:
[
"CMD-SHELL",
"curl --fail http://localhost:9200/_cluster/health || exit 1"
]
interval: 10s
timeout: 5s
retries: 15
logging: *default-logging
deploy:
mode: replicated
replicas: "${ELASTICSEARCH_REPLICAS}"
profiles:
- elasticsearch
discovery-provider:
build:
context: discovery-provider
args:
git_sha: "${GIT_COMMIT}"
command: sh -c ". /tmp/dev-tools/startup/startup.sh && scripts/start.sh"
env_file: .env # used by the startup script
environment:
PYTHONPYCACHEPREFIX: /tmp/pycache
audius_web3_host: "poa-ganache"
audius_web3_port: "8545"
audius_web3_eth_provider_url: "http://eth-ganache:8545"
audius_contracts_registry: "${POA_REGISTRY_ADDRESS}"
audius_contracts_entity_manager_address: "${ENTITY_MANAGER_ADDRESS}"
audius_eth_contracts_registry: "${ETH_REGISTRY_ADDRESS}"
audius_eth_contracts_token: "${ETH_TOKEN_ADDRESS}"
audius_solana_endpoint: "http://solana-test-validator:8899"
audius_solana_track_listen_count_address: "${SOLANA_TRACK_LISTEN_COUNT_PUBLIC_KEY}"
audius_solana_signer_group_address: "${SOLANA_SIGNER_GROUP_PUBLIC_KEY}"
audius_solana_user_bank_program_address: "${SOLANA_CLAIMABLE_TOKENS_PUBLIC_KEY}"
audius_solana_waudio_mint: "${SOLANA_TOKEN_MINT_PUBLIC_KEY}"
audius_solana_rewards_manager_program_address: "${SOLANA_REWARD_MANAGER_PUBLIC_KEY}"
audius_solana_rewards_manager_account: "${SOLANA_REWARD_MANAGER_PDA_PUBLIC_KEY}"
audius_solana_anchor_data_program_id: "${SOLANA_AUDIUS_DATA_PUBLIC_KEY}"
audius_solana_anchor_admin_storage_public_key: "${SOLANA_ADMIN_ACCOUNT_PUBLIC_KEY}"
audius_discprov_dev_mode: "true"
volumes:
- ./discovery-provider/alembic:/audius-discovery-provider/alembic
- ./discovery-provider/solana-tx-parser:/audius-discovery-provider/solana-tx-parser
- ./discovery-provider/src:/audius-discovery-provider/src
- poa-contracts-abis:/audius-discovery-provider/build/contracts
- eth-contracts-abis:/audius-discovery-provider/build/eth-contracts
- solana-programs-idl:/audius-discovery-provider/idl
- ./dev-tools:/tmp/dev-tools
depends_on:
poa-ganache:
condition: service_healthy
eth-ganache:
condition: service_healthy
solana-test-validator:
condition: service_healthy
discovery-provider-elasticsearch:
condition: "${ELASTICSEARCH_CONDITION}"
logging: *default-logging
deploy:
mode: replicated
replicas: "${DISCOVERY_PROVIDER_REPLICAS}"
# creator-node
creator-node:
build:
context: creator-node
args:
git_sha: "${GIT_COMMIT}"
command: sh -c ". /tmp/dev-tools/startup/startup.sh && scripts/start.sh"
env_file: .env # used by the startup script
volumes:
- ./creator-node:/usr/src/app
- ./dev-tools:/tmp/dev-tools
- audius-libs:/usr/src/audius-libs
- /usr/src/app/node_modules
- /usr/src/app/build
depends_on:
poa-ganache:
condition: service_healthy
eth-ganache:
condition: service_healthy
solana-test-validator:
condition: service_healthy
build-audius-libs:
condition: service_started
logging: *default-logging
deploy:
mode: replicated
replicas: "${CREATOR_NODE_REPLICAS}"
# port forwarder
# required for getting consistent port mappings
port-forwarder:
image: alpine:3.16.0
command: sh /tmp/dev-tools/startup/port-forwarder.sh
ports:
- "4000-4010:4000-4010"
- "5000-5010:5000-5010"
volumes:
- ./dev-tools:/tmp/dev-tools
logging: *default-logging
deploy:
mode: global
# SSH server for sshuttle
# we use separate container instead of host machine for dns/auto-hosts functionality
sshuttle-server:
image: linuxserver/openssh-server:latest # don't pin
command: bash /tmp/dev-tools/startup/sshuttle-server.sh
environment:
PUBLIC_KEY_FILE: "/tmp/dev-tools/keys/dev.pub"
USER_NAME: "sshuttle"
ports:
- "2222:2222"
volumes:
- ./dev-tools/:/tmp/dev-tools
logging: *default-logging
deploy:
mode: global
volumes:
poa-contracts-abis:
eth-contracts-abis:
solana-programs-idl:
audius-libs: