This repository was archived by the owner on Oct 31, 2024. It is now read-only.
forked from toncenter/ton-indexer
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
294 lines (287 loc) · 8.42 KB
/
docker-compose.yaml
File metadata and controls
294 lines (287 loc) · 8.42 KB
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
version: '3.3'
services:
web:
profiles: ["backward"]
build:
context: .
dockerfile: deploy/web.Dockerfile
ports:
- ${TON_INDEXER_HTTP_PORT:-80}:8081
environment:
ROOT_PATH: ${TON_INDEXER_ROOT_PATH:-/}
secrets:
- postgres_password
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
command: -w=${TON_INDEXER_WEBSERVER_WORKERS_COUNT:-1} --bind=0.0.0.0:8081
backward_indexer:
profiles: ["backward"]
build:
context: .
dockerfile: deploy/indexer.Dockerfile
command: --concurrency ${TON_INDEXER_BACKWARD_WORKERS_COUNT:-5} -Q backward_queue
restart: on-failure
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
USE_GET_BLOCK_TRANSACTIONS_EXT: ${TON_INDEXER_USE_GET_BLOCK_TRANSACTIONS_EXT:-0}
LITESERVER_INDEX: ${LITESERVER_INDEX_FORWARD:-0}
LITESERVER_CONFIG: ${LITESERVER_CONFIG:-/run/secrets/tonlib_config}
CDLL_PATH: ${CDLL_PATH:-./config/libtonlibjson.so.0.5}
secrets:
- postgres_password
- tonlib_config
logging:
&logging
driver: json-file
options:
max-file: "5"
max-size: "50m"
depends_on:
&common-depends-on
rabbitmq:
condition: service_started
redis:
condition: service_started
postgres:
condition: service_healthy
backward_scheduler:
profiles: ["backward"]
build:
context: .
dockerfile: deploy/scheduler.Dockerfile
command: backward backward_queue
restart: on-failure
logging: *logging
environment:
START_SEQNO: ${TON_INDEXER_START_SEQNO:?start masterchain seqno is required}
BOTTOM_SEQNO: ${TON_INDEXER_BOTTOM_SEQNO:?bottom masterchain seqno is required}
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
WORKERS_COUNT: ${TON_INDEXER_BACKWARD_WORKERS_COUNT:-5}
DISCOVER_ACCOUNTS_ENABLED: ${DISCOVER_ACCOUNTS_ENABLED:-false}
secrets:
- postgres_password
depends_on:
<<: *common-depends-on
backward_indexer:
condition: service_started
forward_indexer:
build:
context: .
dockerfile: deploy/indexer.Dockerfile
command: --concurrency ${TON_INDEXER_FORWARD_WORKERS_COUNT:-2} -Q forward_queue
restart: unless-stopped
logging: *logging
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
USE_GET_BLOCK_TRANSACTIONS_EXT: ${TON_INDEXER_USE_GET_BLOCK_TRANSACTIONS_EXT:-0}
LITESERVER_INDEX: ${LITESERVER_INDEX_FORWARD:-0}
LITESERVER_CONFIG: ${LITESERVER_CONFIG:-/run/secrets/tonlib_config}
CDLL_PATH: ${CDLL_PATH:-./config/libtonlibjson.so.0.5}
DISCOVER_ACCOUNTS_ENABLED: ${DISCOVER_ACCOUNTS_ENABLED:-false}
secrets:
- postgres_password
- tonlib_config
depends_on: *common-depends-on
forward_scheduler:
build:
context: .
dockerfile: deploy/scheduler.Dockerfile
command: forward forward_queue
restart: unless-stopped
logging: *logging
environment:
START_SEQNO: ${TON_INDEXER_START_SEQNO:?start masterchain seqno is required}
BOTTOM_SEQNO: ${TON_INDEXER_BOTTOM_SEQNO:?bottom masterchain seqno is required}
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
WORKERS_COUNT: ${TON_INDEXER_FORWARD_WORKERS_COUNT:-2}
secrets:
- postgres_password
depends_on:
<<: *common-depends-on
forward_indexer:
condition: service_started
accounts_indexer:
build:
context: .
dockerfile: deploy/indexer.Dockerfile
command: --concurrency ${TON_INDEXER_ACCOUNTS_WORKERS_COUNT:-2} -Q accounts_queue
restart: unless-stopped
logging: *logging
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
LITESERVER_INDEX: ${LITESERVER_INDEX_ACCOUNTS:-0}
LITESERVER_CONFIG: ${LITESERVER_CONFIG:-/run/secrets/tonlib_config}
CDLL_PATH: ${CDLL_PATH:-./config/libtonlibjson.so.0.5}
secrets:
- postgres_password
- tonlib_config
depends_on: *common-depends-on
accounts_scheduler:
build:
context: .
dockerfile: deploy/scheduler.Dockerfile
command: accounts accounts_queue create
restart: unless-stopped
logging: *logging
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
WORKERS_COUNT: ${TON_INDEXER_ACCOUNTS_WORKERS_COUNT:-2}
ACCOUNTS_INDEX_MIN_INTERVAL_DAYS: ${ACCOUNTS_INDEX_MIN_INTERVAL_DAYS:-30}
secrets:
- postgres_password
depends_on:
<<: *common-depends-on
accounts_indexer:
condition: service_started
parser:
build:
context: .
dockerfile: deploy/parser.Dockerfile
restart: unless-stopped
logging: *logging
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
REDIS_HOST: redis
REDIS_PORT: 6379
PARSER_EXECUTOR_URL: ${PARSER_EXECUTOR_URL:-http://contracts-executor_1:9090/execute,http://contracts-executor_2:9090/execute,http://contracts-executor_3:9090/execute,http://contracts-executor_4:9090/execute,http://contracts-executor_5:9090/execute}
EVENTBUS_KAFKA_BROKER: ${EVENTBUS_KAFKA_BROKER:-kafka:9092}
EVENTBUS_KAFKA_TOPIC: ${EVENTBUS_KAFKA_TOPIC:-ton_events}
EVENTBUS_ENABLED: ${EVENTBUS_ENABLED:-true}
MESSAGES_KAFKA_STREAM: ${MESSAGES_KAFKA_STREAM:-false}
secrets:
- postgres_password
depends_on:
<<: *common-depends-on
contracts-executor_1:
condition: service_started
contracts-executor_2:
condition: service_started
contracts-executor_3:
condition: service_started
contracts-executor_4:
condition: service_started
contracts-executor_5:
condition: service_started
fetcher:
build:
context: .
dockerfile: deploy/fetcher.Dockerfile
restart: unless-stopped
logging: *logging
environment:
RABBITMQ_HOST: rabbitmq2
RABBITMQ_PORT: 5672
REDIS_HOST: redis2
REDIS_PORT: 6379
secrets:
- postgres_password
depends_on:
<<: *common-depends-on
redis2:
condition: service_started
rabbitmq2:
condition: service_started
contracts-executor_1:
build:
context: contracts-executor
restart: unless-stopped
volumes:
- ./mc_libs_cache/:/opt/mc_libs_cache/
environment:
LIBRARY_CACHE: /opt/mc_libs_cache/mc_libs.txt
logging: *logging
contracts-executor_2:
build:
context: contracts-executor
restart: unless-stopped
volumes:
- ./mc_libs_cache/:/opt/mc_libs_cache/
environment:
LIBRARY_CACHE: /opt/mc_libs_cache/mc_libs_2.txt
logging: *logging
contracts-executor_3:
build:
context: contracts-executor
restart: unless-stopped
volumes:
- ./mc_libs_cache/:/opt/mc_libs_cache/
environment:
LIBRARY_CACHE: /opt/mc_libs_cache/mc_libs_3.txt
logging: *logging
contracts-executor_4:
build:
context: contracts-executor
restart: unless-stopped
volumes:
- ./mc_libs_cache/:/opt/mc_libs_cache/
environment:
LIBRARY_CACHE: /opt/mc_libs_cache/mc_libs_4.txt
logging: *logging
contracts-executor_5:
build:
context: contracts-executor
restart: unless-stopped
volumes:
- ./mc_libs_cache/:/opt/mc_libs_cache/
environment:
LIBRARY_CACHE: /opt/mc_libs_cache/mc_libs_5.txt
logging: *logging
rabbitmq2:
image: rabbitmq
restart: unless-stopped
redis2:
image: redis:latest
restart: unless-stopped
rabbitmq:
image: rabbitmq
restart: unless-stopped
redis:
image: redis:latest
restart: unless-stopped
postgres:
image: postgres
restart: unless-stopped
shm_size: 1gb
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
ports:
- 5432:5432
secrets:
- postgres_password
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data:
external: false
secrets:
postgres_password:
file: private/postgres_password
tonlib_config:
file: ${TON_INDEXER_LITE_SERVER_CONFIG:?liteserver config file is required}