-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
97 lines (90 loc) · 3.27 KB
/
docker-compose.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
# Requires docker-compose >= 1.29.0
version: '3.9'
volumes:
testnet_v1-web3-indexer-data:
testnet_v1-redis-data:
services:
# Note: To achieve higher sync speed, please run your own ckb-testnet-node and ckb-testnet-indexer,
# and update [rpc_client] in gw-testnet_v1-config-readonly.toml.
# see: https://docs.nervos.org/docs/basics/guides/run-ckb-with-docker#run-a-ckb-testnet-node
gw-readonly:
container_name: gw-testnet_v1-readonly
image: ghcr.io/godwokenrises/godwoken:v1.15.0-smt-trie
expose: [8119, 8219]
healthcheck:
test: /bin/gw-healthcheck.sh
start_period: 10s
interval: 30s
# It takes a long time to synchronize for the first time.
retries: 100000
working_dir: /deploy
volumes:
- ./chain-data/readonly/:/mnt/
- ./gw-testnet_v1-config-readonly.toml:/deploy/config.toml
- ./db.toml:/deploy/db.toml:ro
environment:
# other log envs: ,gw_generator=debug,gw_chain=debug
- RUST_LOG=info
command: |
bash -c 'set -ex
# migrate command for SMT trie feature, only needs to be run on first activation
godwoken migrate --config /deploy/config.toml | tee -a /mnt/smt-migrate.log
# use this command to rewind the chain to the last valid block, if the node has encountered
# some bad blocks accidentally due to e.g. version/configuration differences.
# see also: https://github.com/godwokenrises/godwoken/pull/832
# godwoken rewind-to-last-valid-block --config-path /deploy/config.toml
# Run Godwoken
godwoken run -c /deploy/config.toml
'
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
postgres:
image: postgres:alpine
expose: [5432]
environment:
POSTGRES_DB: web3-indexer-db
POSTGRES_USER: your_db_user_name
POSTGRES_PASSWORD: your_password
volumes:
- testnet_v1-web3-indexer-data:/var/lib/postgresql/data
redis:
image: redis:bullseye
user: redis:redis
volumes:
- testnet_v1-redis-data:/data
web3:
image: ghcr.io/godwokenrises/godwoken-web3-prebuilds:v1.15.0
healthcheck:
test: curl http://127.0.0.1:8024 || exit 1
volumes:
- ./web3.env:/godwoken-web3/packages/api-server/.env
working_dir: /godwoken-web3
command: bash -c 'set -ex ; yarn knex migrate:latest && yarn start:prod'
ports: [8024:8024]
depends_on:
redis:
condition: service_started
postgres:
condition: service_started
gw-readonly:
condition: service_healthy
web3-indexer:
image: ghcr.io/godwokenrises/godwoken-web3-indexer-prebuilds:v1.15.0
volumes:
- ./web3-indexer-config.toml:/var/lib/web3-indexer/indexer-config.toml
- ./chain-data/logs:/var/lib/web3-indexer/logs
# How to re-sync web3-indexer at /var/lib/web3-indexer/ ?
# ➜ nohup gw-web3-indexer update <startBlock> <endBlock> > logs/web3-indexer-update.log 2>&1 &
# or
# ➜ nohup gw-web3-indexer update > logs/web3-indexer-update.log 2>&1 &
# refer to: https://github.com/godwokenrises/godwoken-web3/blob/main/README.md#update-blocks
working_dir: /var/lib/web3-indexer
command: [ "gw-web3-indexer" ]
environment:
- RUST_LOG=info
restart: unless-stopped
depends_on:
web3:
condition: service_healthy