|
| 1 | +x-indexer-environment: &indexer-env |
| 2 | + POSTGRES_DIALECT: postgresql+asyncpg |
| 3 | + POSTGRES_HOST: index-postgres |
| 4 | + POSTGRES_PORT: 5432 |
| 5 | + POSTGRES_USER: postgres |
| 6 | + POSTGRES_PASSWORD: PostgreSQL1234 |
| 7 | + POSTGRES_DBNAME: ton_index |
| 8 | + TON_INDEXER_IS_TESTNET: 0 |
| 9 | + TON_INDEXER_REDIS_DSN: redis://event-cache:6379 |
| 10 | + |
| 11 | + TON_WORKER_FROM: 1 |
| 12 | + TON_WORKER_DBROOT: /tondb |
| 13 | + TON_WORKER_BINARY: ton-index-postgres-v2 |
| 14 | + TON_WORKER_ADDITIONAL_ARGS: |
| 15 | + |
| 16 | + |
| 17 | +services: |
| 18 | + genesis: |
| 19 | + container_name: genesis |
| 20 | + image: ghcr.io/neodix42/mylocalton-docker:latest |
| 21 | + restart: unless-stopped |
| 22 | + ports: |
| 23 | + - 8000:8000 # simple file http server |
| 24 | + - 40004:40004 # lite-server |
| 25 | + - "40003:40003/udp" # dht-server |
| 26 | + - 40002:40002 # validator-console |
| 27 | + - "40001:40001/udp" # validator public port |
| 28 | + volumes: |
| 29 | + - shared-data:/usr/share/data |
| 30 | + - ton-db:/var/ton-work/db # docker persistent storage for ton db |
| 31 | + environment: |
| 32 | + - GENESIS=true |
| 33 | + - NAME=genesis |
| 34 | +# - ENABLE_FILE_HTTP_SERVER=false #default true |
| 35 | +# - NEXT_BLOCK_GENERATION_DELAY=2 #default 2000 (2 seconds) |
| 36 | +# - EXTERNAL_IP= # used to generate external.global.config.json that allows remote users to connect to lite-server via public IP |
| 37 | +# - VALIDATION_PERIOD=86400 # 24h, default 20min |
| 38 | +# - MASTERCHAIN_ONLY=true # default false |
| 39 | +# - HIDE_PRIVATE_KEYS=true # default false, defines whether to expose private keys (faucet+validators) via htt-server on 127.0.0.1:8000 and generates new private keys for validators and faucets |
| 40 | +# - VERBOSITY=4 |
| 41 | + - CUSTOM_PARAMETERS=--state-ttl 315360000 --archive-ttl 315360000 |
| 42 | + |
| 43 | + healthcheck: |
| 44 | + test: /usr/local/bin/lite-client -a 127.0.0.1:40004 -b E7XwFSQzNkcRepUC23J2nRpASXpnsEKmyyHYV4u/FZY= -t 3 -c last |
| 45 | + interval: 30s |
| 46 | + timeout: 20s |
| 47 | + retries: 10 |
| 48 | + networks: |
| 49 | + default: |
| 50 | + ipv4_address: 172.28.1.1 |
| 51 | + |
| 52 | + blockchain-explorer: |
| 53 | + container_name: blockchain-explorer |
| 54 | + image: ghcr.io/neodix42/mylocalton-docker-explorer:latest |
| 55 | + restart: unless-stopped |
| 56 | + environment: |
| 57 | + - SERVER_PORT=8080 |
| 58 | + ports: |
| 59 | + - 8080:8080 |
| 60 | + healthcheck: |
| 61 | + test: curl -sS http://127.0.0.1:8080/last || echo 1 |
| 62 | + interval: 15s |
| 63 | + timeout: 10s |
| 64 | + retries: 3 |
| 65 | + volumes: |
| 66 | + - shared-data:/usr/share/data |
| 67 | + depends_on: |
| 68 | + genesis: |
| 69 | + condition: service_healthy |
| 70 | + |
| 71 | +# validator-1: |
| 72 | +# container_name: validator-1 |
| 73 | +# image: ghcr.io/neodix42/mylocalton-docker:latest |
| 74 | +# restart: unless-stopped |
| 75 | +# volumes: |
| 76 | +# - shared-data:/usr/share/data |
| 77 | +# environment: |
| 78 | +# - NAME=validator-1 |
| 79 | +# - GENESIS_IP=172.28.1.1 |
| 80 | +# depends_on: |
| 81 | +# - "genesis" |
| 82 | +# |
| 83 | +# validator-2: |
| 84 | +# container_name: validator-2 |
| 85 | +# image: ghcr.io/neodix42/mylocalton-docker:latest |
| 86 | +# restart: unless-stopped |
| 87 | +# volumes: |
| 88 | +# - shared-data:/usr/share/data |
| 89 | +# environment: |
| 90 | +# - NAME=validator-2 |
| 91 | +# - GENESIS_IP=172.28.1.1 |
| 92 | +# depends_on: |
| 93 | +# - "genesis" |
| 94 | +# |
| 95 | +# validator-3: |
| 96 | +# container_name: validator-3 |
| 97 | +# image: ghcr.io/neodix42/mylocalton-docker:latest |
| 98 | +# restart: unless-stopped |
| 99 | +# volumes: |
| 100 | +# - shared-data:/usr/share/data |
| 101 | +# environment: |
| 102 | +# - NAME=validator-3 |
| 103 | +# - GENESIS_IP=172.28.1.1 |
| 104 | +# depends_on: |
| 105 | +# - "genesis" |
| 106 | +# |
| 107 | +# validator-4: |
| 108 | +# container_name: validator-4 |
| 109 | +# image: ghcr.io/neodix42/mylocalton-docker:latest |
| 110 | +# restart: unless-stopped |
| 111 | +# volumes: |
| 112 | +# - shared-data:/usr/share/data |
| 113 | +# environment: |
| 114 | +# - NAME=validator-4 |
| 115 | +# - GENESIS_IP=172.28.1.1 |
| 116 | +# depends_on: |
| 117 | +# - "genesis" |
| 118 | +# |
| 119 | +# validator-5: |
| 120 | +# container_name: validator-5 |
| 121 | +# image: ghcr.io/neodix42/mylocalton-docker:latest |
| 122 | +# restart: unless-stopped |
| 123 | +# volumes: |
| 124 | +# - shared-data:/usr/share/data |
| 125 | +# environment: |
| 126 | +# - NAME=validator-5 |
| 127 | +# - GENESIS_IP=172.28.1.1 |
| 128 | +# depends_on: |
| 129 | +# - "genesis" |
| 130 | + |
| 131 | + tonhttpapi: |
| 132 | + container_name: ton-http-api |
| 133 | + image: ghcr.io/neodix42/ton-http-api:latest |
| 134 | + ports: |
| 135 | + - 8081:8081 |
| 136 | + volumes: |
| 137 | + - shared-data:/usr/share/data |
| 138 | + environment: |
| 139 | + - TON_API_CACHE_ENABLED |
| 140 | + - TON_API_CACHE_REDIS_ENDPOINT |
| 141 | + - TON_API_CACHE_REDIS_PORT |
| 142 | + - TON_API_CACHE_REDIS_TIMEOUT |
| 143 | + - TON_API_LOGS_JSONIFY=0 |
| 144 | + - TON_API_LOGS_LEVEL=ERROR |
| 145 | + - TON_API_TONLIB_LITESERVER_CONFIG=/usr/share/data/global.config.json |
| 146 | + - TON_API_TONLIB_KEYSTORE |
| 147 | + - TON_API_TONLIB_PARALLEL_REQUESTS_PER_LITESERVER |
| 148 | + - TON_API_TONLIB_CDLL_PATH=/usr/share/data/libtonlibjson.so |
| 149 | + - TON_API_TONLIB_REQUEST_TIMEOUT |
| 150 | + - TON_API_GET_METHODS_ENABLED=1 |
| 151 | + - TON_API_JSON_RPC_ENABLED=1 |
| 152 | + restart: unless-stopped |
| 153 | + depends_on: |
| 154 | + genesis: |
| 155 | + condition: service_healthy |
| 156 | + command: -c "gunicorn -k uvicorn.workers.UvicornWorker -w 1 --bind 0.0.0.0:8081 pyTON.main:app" |
| 157 | + healthcheck: |
| 158 | + test: curl -sS http://127.0.0.1:8081/healthcheck || echo 1 |
| 159 | + interval: 30s |
| 160 | + timeout: 5s |
| 161 | + retries: 10 |
| 162 | + |
| 163 | + faucet: |
| 164 | + container_name: faucet |
| 165 | + image: ghcr.io/neodix42/mylocalton-docker-faucet:latest |
| 166 | + ports: |
| 167 | + - 88:88 |
| 168 | + volumes: |
| 169 | + - shared-data:/usr/share/data |
| 170 | + restart: unless-stopped |
| 171 | + depends_on: |
| 172 | + genesis: |
| 173 | + condition: service_healthy |
| 174 | + environment: |
| 175 | + - FAUCET_USE_RECAPTCHA=false # default true |
| 176 | + - RECAPTCHA_SITE_KEY= # google reCaptcha v2 |
| 177 | + - RECAPTCHA_SECRET= # google reCaptcha v2 |
| 178 | +# - MASTERCHAIN_ONLY=true # default false, if true generates new addresses only in masterchain (-1) |
| 179 | +# - FAUCET_REQUEST_EXPIRATION_PERIOD=3600 # default 86400 seconds (24h) |
| 180 | +# - FAUCET_SINGLE_GIVEAWAY=100 # default 10 toncoins |
| 181 | + - SERVER_PORT=88 |
| 182 | + healthcheck: |
| 183 | + test: curl -sS http://127.0.0.1:88|| echo 1 |
| 184 | + |
| 185 | +# data: |
| 186 | +# container_name: data |
| 187 | +# image: ghcr.io/neodix42/mylocalton-docker-data:latest |
| 188 | +# ports: |
| 189 | +# - 99:99 |
| 190 | +# volumes: |
| 191 | +# - shared-data:/usr/share/data |
| 192 | +# restart: unless-stopped |
| 193 | +# depends_on: |
| 194 | +# genesis: |
| 195 | +# condition: service_healthy |
| 196 | +# environment: |
| 197 | +# - SERVER_PORT=99 |
| 198 | +# - PERIOD=5 |
| 199 | +# healthcheck: |
| 200 | +# test: curl -sS http://127.0.0.1:99|| echo 1 |
| 201 | + |
| 202 | + restarter: |
| 203 | + container_name: explorer-restarter |
| 204 | + image: docker:cli |
| 205 | + restart: unless-stopped |
| 206 | + volumes: [ "/var/run/docker.sock:/var/run/docker.sock" ] |
| 207 | + command: [ "/bin/sh", "-c", "while true; do sleep 3600; echo restarted; docker restart blockchain-explorer; done" ] |
| 208 | + depends_on: |
| 209 | + blockchain-explorer: |
| 210 | + condition: service_healthy |
| 211 | + |
| 212 | + # toncenter api v3 |
| 213 | + event-cache: |
| 214 | + container_name: event-cache |
| 215 | + image: redis:latest |
| 216 | + restart: unless-stopped |
| 217 | + |
| 218 | + index-postgres: |
| 219 | + container_name: index-postgres |
| 220 | + image: postgres:17 |
| 221 | + # ports: |
| 222 | + # - 5432:5432 |
| 223 | + environment: *indexer-env |
| 224 | + 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 |
| 225 | + healthcheck: |
| 226 | + test: [ "CMD-SHELL", "pg_isready -U postgres" ] |
| 227 | + interval: 5s |
| 228 | + timeout: 5s |
| 229 | + retries: 5 |
| 230 | + shm_size: 2G |
| 231 | + restart: unless-stopped |
| 232 | + volumes: |
| 233 | + - postgres-data:/var/lib/postgresql/data |
| 234 | + |
| 235 | + event-classifier: |
| 236 | + container_name: event-classifier |
| 237 | + image: toncenter/ton-indexer-classifier:v1.2.0-test |
| 238 | + command: --pool-size 4 --prefetch-size 1000 --batch-size 100 |
| 239 | + environment: *indexer-env |
| 240 | + restart: unless-stopped |
| 241 | + depends_on: |
| 242 | + - index-worker |
| 243 | + - event-cache |
| 244 | + |
| 245 | + index-api: |
| 246 | + container_name: index-api |
| 247 | + image: toncenter/ton-indexer-api:v1.2.0-test |
| 248 | + command: -bind ":8082" -prefork -threads 4 -v2 http://tonhttpapi:8081/ |
| 249 | + ports: |
| 250 | + - 8082:8082 |
| 251 | + environment: *indexer-env |
| 252 | + restart: unless-stopped |
| 253 | + depends_on: |
| 254 | + - index-worker |
| 255 | + |
| 256 | + index-worker: |
| 257 | + container_name: index-worker |
| 258 | + image: toncenter/ton-indexer-worker:v1.2.0-test |
| 259 | + volumes: |
| 260 | + - ton-db:/tondb |
| 261 | + - index-workdir:/workdir |
| 262 | + environment: *indexer-env |
| 263 | + command: --working-dir /workdir --from 1 --threads 8 |
| 264 | + restart: unless-stopped |
| 265 | + depends_on: |
| 266 | + genesis: |
| 267 | + condition: service_healthy |
| 268 | + index-postgres: |
| 269 | + condition: service_healthy |
| 270 | +volumes: |
| 271 | + shared-data: |
| 272 | + postgres-data: |
| 273 | + index-workdir: |
| 274 | + ton-db: |
| 275 | +# # uncomment if you want to mount this image in folder |
| 276 | +# driver: local |
| 277 | +# driver_opts: |
| 278 | +# o: bind |
| 279 | +# type: none |
| 280 | +# device: /home/user/ton-db |
| 281 | + |
| 282 | +networks: |
| 283 | + default: |
| 284 | + ipam: |
| 285 | + driver: default |
| 286 | + config: |
| 287 | + - subnet: 172.28.0.0/16 |
0 commit comments