forked from reef-defi/reef-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
178 lines (167 loc) · 5.32 KB
/
docker-compose-prod.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
version: '3.7'
services:
substrate-node:
image: taulepton/reef:v8
volumes:
- substrate-data:/data
ports:
- ${EXPOSE_NODE_PORT}:${NODE_PORT}
- ${EXPOSE_NODE_WS}:${NODE_WS}
# TODO paramaterise chain
command: -d /data --rpc-max-payload 1024 --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'
ports:
- ${EXPOSE_DB}: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: taulepton/reef-graphql:${VERSION}
build:
context: .
dockerfile: Dockerfile.graphql
ports:
- ${EXPOSE_GQL_PORT}:8080
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: taulepton/reef-crawler:${VERSION}
build:
context: .
dockerfile: Dockerfile.prod
args:
COMPONENT: crawler
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=${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
- ENVIRONMENT=${ENVIRONMENT}
- NETWORK=${NETWORK}
- SUBCONTRACT_INTERVAL=${SUBCONTRACT_INTERVAL}
- LIVE_GRAPHQL_URL=${LIVE_GRAPHQL_URL}
- VERIFIED_CONTRACT_SYNC=${VERIFIED_CONTRACT_SYNC}
- VERIFIED_CONTRACT_SYNC_INTERVAL=${VERIFIED_CONTRACT_SYNC_INTERVAL}
depends_on:
- 'postgres'
- 'substrate-node'
networks:
- reefscan
backtracking:
image: taulepton/reef-crawler:${VERSION}
command: /wait-for http://graphql:8080/healthz -t 0 -- yarn start-backtracking
restart: always
environment:
- NODE_PROVIDER_URLS=["ws://substrate-node:9944"] #TODO extract this list
- SENTRY_DNS=${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
- ENVIRONMENT=${ENVIRONMENT}
- NETWORK=${NETWORK}
depends_on:
- 'postgres'
- 'substrate-node'
networks:
- reefscan
pool:
image: taulepton/reef-crawler:${VERSION}
command: /wait-for http://graphql:8080/healthz -t 0 -- yarn start-pool
restart: always
environment:
- FACTORY_ADDRESS=${FACTORY_ADDRESS}
- NODE_PROVIDER_URLS=["ws://substrate-node:9944"] #TODO extract this list
- SENTRY_DNS=${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
- ENVIRONMENT=${ENVIRONMENT}
- NETWORK=${NETWORK}
depends_on:
- 'postgres'
- 'substrate-node'
networks:
- reefscan
api:
image: taulepton/reef-api:${VERSION}
build:
context: .
dockerfile: Dockerfile.prod
args:
COMPONENT: api
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
- SENTRY_DNS=${SENTRY_DNS}
- ENVIRONMENT=${ENVIRONMENT}
- NETWORK=${NETWORK}
ports:
- ${EXPOSE_API_PORT}:${API_PORT}
depends_on:
- postgres
- substrate-node
networks:
- reefscan
frontend:
image: taulepton/reef-frontend:${VERSION}
build:
context: .
dockerfile: Dockerfile.prod
args:
COMPONENT: frontend
ports:
- ${EXPOSE_FE_PORT}:${FE_PORT}
environment:
- HOST=0.0.0.0
networks:
- reefscan
# Persistent volumes
volumes:
db-data: {}
substrate-data: {}
networks:
reefscan: