forked from fmira21/ton-node-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (121 loc) · 3.55 KB
/
docker-compose.yml
File metadata and controls
126 lines (121 loc) · 3.55 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
version: '3.7'
services:
ton-node:
build:
context: build
dockerfile: Dockerfile.node
args:
VER: ${NODE_VERSION}
command:
- /usr/bin/ton/validator-engine/validator-engine
- -c
- /var/ton-work/db/config.json
- -C
- /var/ton-work/db/ton-global.config
- --db
- /var/ton-work/db
# you can set higher count of threads depending on your needs
# - --threads
# - "31"
# increase if you are using 3-month snapshot
# - --state-ttl
# - "7776000"
# - --archive-ttl
# - "86400"
logging:
driver: json-file
options:
max-size: "100m"
max-file: "40"
image: ton-node:${NODE_VERSION}
restart: always
ports:
- 127.0.0.1:${NODE_CONSOLE_PORT}:${NODE_CONSOLE_PORT}
- 127.0.0.1:${NODE_CONSOLE_PORT}:${NODE_CONSOLE_PORT}/udp
- 127.0.0.1:${NODE_LITESERVER_PORT}:${NODE_LITESERVER_PORT}
# leave liteserver udp port public for p2p communication
- ${NODE_LITESERVER_PORT}:${NODE_LITESERVER_PORT}/udp
volumes:
- ${NODE_STATE_VOLUME}:/var/ton-work/db
- ${NODE_LOG_VOLUME}:/var/ton-work/log
environment:
GCONFURL: ${NODE_CONFIG_URL}
PUBLIC_IP: ${NODE_PUBLIC_IP}
LITESERVER: ${NODE_LITESERVER}
LITE_PORT: ${NODE_LITESERVER_PORT}
CONSOLE_PORT: ${NODE_CONSOLE_PORT}
networks:
ton-network:
ipv4_address: 172.18.0.2
ton-api:
depends_on:
- redis
- ton-node
build:
context: build
dockerfile: Dockerfile.api
args:
VER: ${API_VERSION}
logging:
driver: json-file
options:
max-size: "100m"
max-file: "10"
image: ton-api
restart: always
ports:
- 127.0.0.1:8081:8081
volumes:
- ${API_CONF_VOLUME}:/conf
environment:
TON_API_CACHE_ENABLED: "${API_CACHE_ENABLED}"
TON_API_CACHE_REDIS_TIMEOUT: ${API_CACHE_REDIS_TIMEOUT}
TON_API_CACHE_REDIS_ENDPOINT: ${API_CACHE_REDIS_ENDPOINT}
TON_API_CACHE_REDIS_PORT: ${API_CACHE_REDIS_PORT}
TON_API_LOGS_JSONIFY: ${API_LOGS_JSONIFY}
TON_API_LOGS_LEVEL: ${API_LOGS_LEVEL}
TON_API_TONLIB_LITESERVER_CONFIG: ${API_TONLIB_LITESERVER_CONFIG}
TON_API_TONLIB_PARALLEL_REQUESTS_PER_LITESERVER: ${API_TONLIB_PARALLEL_REQUESTS_PER_LITESERVER}
TON_API_TONLIB_REQUEST_TIMEOUT: ${API_TONLIB_REQUEST_TIMEOUT}
TON_API_GET_METHODS_ENABLED: ${API_GET_METHODS_ENABLED}
TON_API_JSON_RPC_ENABLED: ${API_JSON_RPC_ENABLED}
TON_API_ROOT_PATH: ${API_ROOT_PATH}
TON_API_WEBSERVERS_WORKERS: ${API_WEBSERVERS_WORKERS}
command:
- -c
- gunicorn -k uvicorn.workers.UvicornWorker -w ${API_WEBSERVERS_WORKERS} --bind 0.0.0.0:8081 pyTON.main:app
healthcheck:
test: curl -fsS http://127.0.0.1:8081${API_ROOT_PATH}healthcheck || exit 1
interval: 15s
timeout: 3s
retries: 12
networks:
ton-network:
ipv4_address: 172.18.0.3
nginx:
image: nginx:stable
restart: always
ports:
- ${NGINX_PORT}:${NGINX_PORT}
volumes:
- ${NGINX_CONF_VOLUME}/default.conf.template:/etc/nginx/templates/default.conf.template:ro
environment:
NGINX_HOST: ${NGINX_HOST}
NGINX_PORT: ${NGINX_PORT}
NGINX_PROXY_HOST: http://ton-api
NGINX_PROXY_PORT: 8081
networks:
ton-network:
ipv4_address: 172.18.0.4
redis:
image: redis:7.2
restart: always
networks:
ton-network:
ipv4_address: 172.18.0.5
networks:
ton-network:
driver: bridge
ipam:
config:
- subnet: 172.18.0.0/24