forked from reef-defi/reef-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
173 lines (163 loc) · 5.55 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
version: '3.7'
services:
substrate-node:
build:
context: ${NODE_BUILD_CONTEXT}
image: ${NODE_IMAGE}
volumes:
- substrate-data:/data
ports:
- ${NODE_PORT}:${NODE_PORT}
- ${NODE_WS}:${NODE_WS}
# TODO paramaterise chain
command: -d /data --ws-max-connections ${NODE_MAX_CONS} ${NODE_CHAIN_CMD} ${NODE_CHAIN} --pruning=archive --rpc-cors "*" --ws-port ${NODE_WS} --port ${NODE_PORT} --unsafe-ws-external --no-prometheus --no-telemetry
restart: always
networks:
- reefscan
postgres:
image: postgres:13
restart: always
shm_size: 1gb
volumes:
- 'db-data:/var/lib/postgresql/data'
- './db/sql/initialization/init.sql:/docker-entrypoint-initdb.d/00_init.sql'
- './db/sql/initialization/block.sql:/docker-entrypoint-initdb.d/01_block.sql'
- './db/sql/initialization/account.sql:/docker-entrypoint-initdb.d/02_account.sql'
- './db/sql/initialization/extrinsic.sql:/docker-entrypoint-initdb.d/03_extrinsic.sql'
- './db/sql/initialization/event.sql:/docker-entrypoint-initdb.d/04_event.sql'
- './db/sql/initialization/contract.sql:/docker-entrypoint-initdb.d/05_contract.sql'
- './db/sql/initialization/evmEvent.sql:/docker-entrypoint-initdb.d/06_evmEvent.sql'
- './db/sql/initialization/transfer.sql:/docker-entrypoint-initdb.d/07_transfer.sql'
- './db/sql/initialization/staking.sql:/docker-entrypoint-initdb.d/08_staking.sql'
- './db/sql/initialization/tokenHolder.sql:/docker-entrypoint-initdb.d/08_tokenHolder.sql'
- './db/sql/initialization/newlyVerifiedContract.sql:/docker-entrypoint-initdb.d/09_newlyVerifiedContract.sql'
- './db/sql/initialization/chainInfo.sql:/docker-entrypoint-initdb.d/10_chainInfo.sql'
ports:
- 5432:5432
environment:
POSTGRES_USER: ${DB_USER} #'reefexplorer'
POSTGRES_PASSWORD: ${DB_PW} #'reefexplorer'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U reefexplorer']
interval: 5s
timeout: 5s
retries: 5
networks:
- reefscan
graphql:
image: hasura/graphql-engine:v2.1.1.cli-migrations-v3
ports:
- 8080:8080
volumes:
- './db/hasura/metadata:/hasura-metadata'
depends_on:
- 'postgres'
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: ${DB_URL} #postgres://reefexplorer:reefexplorer@postgres:5432/reefexplorer
HASURA_GRAPHQL_ENABLE_CONSOLE: ${GQL_CONSOLE} #'true' # set to "false" to disable console
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: ${GQL_UNAUTHORIZED_ROLE} #public
HASURA_GRAPHQL_ADMIN_SECRET: ${GQL_ADMIN_PW} #myadminsecretkey
HASURA_GRAPHQL_V1_BOOLEAN_NULL_COLLAPSE: "true"
networks:
- reefscan
crawler:
image: reef-explorer-crawler-dev
build:
context: .
args:
COMPONENT: crawler
volumes:
- crawler-modules:/usr/app/node_modules
- ./crawler:/usr/app/
restart: always
environment:
- NODE_PROVIDER_URLS=["ws://substrate-node:9944"] #TODO extract this list
- START_BLOCK_STEP=32
# with 8 nodes you can process up to 4096 blocks at once but rather keep it at 1024 if server doesn't have a lot of RAM.
# Currently we support node with 16Gb of RAM. To change the capacity go in `./crawler/package.json` and change --max-old-space-size=16384 to desired size
- MAX_BLOCKS_PER_STEP=32
- SENTRY_DNS=${CRAWLER_SENTRY_DNS}
- POSTGRES_PORT=${DB_PORT} #5432
- POSTGRES_HOST=${DB_HOST}
- POSTGRES_USER=${DB_USER} #reefexplorer
- POSTGRES_DATABASE=${DB_NAME} #reefexplorer
- POSTGRES_PASSWORD=${DB_PW} #reefexplorer
depends_on:
- 'postgres'
- 'substrate-node'
networks:
- reefscan
backtracking:
image: reef-explorer-crawler-dev
command: yarn dev-backtracking
volumes:
- backtracking-modules:/usr/app/node_modules
- ./crawler:/usr/app/
restart: always
environment:
- NODE_PROVIDER_URLS=["ws://substrate-node:9944"] #TODO extract this list
- SENTRY_DNS=${CRAWLER_SENTRY_DNS}
- POSTGRES_PORT=${DB_PORT} #5432
- POSTGRES_HOST=${DB_HOST}
- POSTGRES_USER=${DB_USER} #reefexplorer
- POSTGRES_DATABASE=${DB_NAME} #reefexplorer
- POSTGRES_PASSWORD=${DB_PW} #reefexplorer
depends_on:
- 'postgres'
- 'substrate-node'
networks:
- reefscan
api:
image: reef-explorer-api-dev
build:
context: .
args:
COMPONENT: api
volumes:
- api-modules:/usr/app/node_modules
- ./api:/usr/app/
restart: always
environment:
- PORT=${API_PORT} #8000
- NODE_URL=ws://${NODE_HOST}:${NODE_WS}
- POSTGRES_PORT=${DB_PORT}
- POSTGRES_HOST=${DB_HOST}
- POSTGRES_USER=${DB_USER}
- POSTGRES_DATABASE=${DB_NAME}
- POSTGRES_PASSWORD=${DB_PW}
- RECAPTCHA_SECRET=6LfNcPIaAAAAADSldnLXXxSrXIYH532l0cSsfDEU
ports:
- ${API_PORT}:${API_PORT}
depends_on:
- postgres
- substrate-node
networks:
- reefscan
frontend:
build:
context: .
args:
COMPONENT: frontend
image: reef-explorer-frontend-dev
volumes:
- frontend-modules:/usr/app/node_modules
- ./frontend:/usr/app/
ports:
- ${FE_PORT}:${FE_PORT}
environment:
- HOST=0.0.0.0
networks:
- reefscan
# Persistent volumes
volumes:
db-data: {}
substrate-data: {}
crawler-modules: {}
backtracking-modules: {}
api-modules: {}
frontend-modules: {}
networks:
reefscan:
name: reefscan