-
Notifications
You must be signed in to change notification settings - Fork 37
/
docker-compose.yaml
109 lines (99 loc) · 2.55 KB
/
docker-compose.yaml
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
version: "3.9"
x-indexer-environment: &index-common
POSTGRES_DIALECT: ${POSTGRES_DIALECT:-postgresql+asyncpg}
POSTGRES_HOST:
POSTGRES_PORT:
POSTGRES_USER:
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
POSTGRES_DBNAME:
POSTGRES_DBROOT:
POSTGRES_PUBLISH_PORT:
x-index-api: &index-api
TON_INDEXER_API_ROOT_PATH:
TON_INDEXER_API_PORT:
TON_INDEXER_TON_HTTP_API_ENDPOINT:
TON_INDEXER_IS_TESTNET:
TON_INDEXER_REDIS_DSN: redis://event-cache:6379
<<: *index-common
x-index-worker: &index-worker
TON_WORKER_FROM:
TON_WORKER_DBROOT: /tondb
TON_WORKER_BINARY: ton-index-postgres-v2
TON_WORKER_ADDITIONAL_ARGS:
<<: *index-common
services:
event-cache:
image: redis:latest
networks:
- internal
command: redis-server --maxclients 40000
event-classifier:
build:
context: indexer
dockerfile: Dockerfile
secrets:
- postgres_password
command: python3 /app/event_classifier.py --pool-size ${TON_INDEXER_WORKERS:-8} --fetch-size 10000 --batch-size 500
environment: *index-api
networks:
internal:
index-api:
build:
context: ton-index-go
dockerfile: Dockerfile
secrets:
- postgres_password
command: -prefork -threads ${TON_INDEXER_WORKERS:-1}
ports:
- target: 8081
published: ${TON_INDEXER_API_PORT:-8081}
environment: *index-api
restart: always
networks:
internal:
index-worker:
build:
context: ton-index-cpp
dockerfile: Dockerfile
secrets:
- postgres_password
volumes:
- ${TON_WORKER_DBROOT:-./}:/tondb
environment: *index-worker
networks:
internal:
command: --from ${TON_WORKER_FROM:-1}
restart: unless-stopped
postgres:
image: postgres:16
environment: *index-common
ports:
- ${POSTGRES_PUBLISH_PORT:-5432}:5432
secrets:
- postgres_password
command: postgres -c max_connections=1024 -c shared_buffers=4GB -c work_mem=64MB -c max_wal_size=1GB -c tcp_keepalives_idle=60 -c tcp_keepalives_interval=60 -c tcp_keepalives_count=60
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
shm_size: 2G
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
internal:
logging:
driver: local
options:
max-size: 4G
volumes:
postgres_data:
external: false
networks:
internal:
attachable: true
external: false
secrets:
postgres_password:
file: ${POSTGRES_PASSWORD_FILE:-private/postgres_password}