-
Notifications
You must be signed in to change notification settings - Fork 24
/
docker-compose.yml
198 lines (188 loc) · 5.21 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
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
# Requires docker-compose >= 1.29.0
version: '3.8'
services:
postgres:
image: postgres:alpine
ports:
- 5432:5432
environment:
POSTGRES_USER: user
POSTGRES_DB: lumos
POSTGRES_PASSWORD: password
volumes:
- ./postgres/data:/var/lib/postgresql/data
redis:
image: redis:bullseye
user: root:root
ports:
- 6379:6379
volumes:
- ./redis/data:/data
# TODO: update CKB version
ckb:
image: nervos/ckb:v0.103.0
user: root
ports:
- 8114:8114 # rpc
- 8115:8115 # p2p network
volumes:
- ./layer1/ckb:/var/lib/ckb
command: [ "run", "-C", "/var/lib/ckb" ]
# TODO: update CKB version
ckb-miner:
init: true
image: nervos/ckb:v0.103.0
user: root
volumes:
- ./layer1/ckb:/var/lib/ckb
command: [ "miner", "-C", "/var/lib/ckb" ]
# "nervos/ckb" image have no http clients to do health check for CKB.
# This short-term service act as a workaround to do health check.
check-ckb-started-successfully:
image: curlimages/curl
volumes:
- ./layer1/ckb:/var/lib/ckb
command: [ 'http://ckb:8114', '-H', 'content-type: application/json', '-d', '{ "id": 2, "jsonrpc": "2.0", "method": "get_tip_block_number", "params": [] }' ]
deploy:
restart_policy:
condition: on-failure
max_attempts: 1000
depends_on:
- ckb
ckb-indexer:
image: nervos/ckb-indexer:0.3.2
init: true
environment:
CKB_RPC: http://ckb:8114
ports:
- "8116:8116"
volumes:
- ./ckb-indexer:/var/lib/ckb-indexer
command: [ "-c", "http://ckb:8114", "-l", "0.0.0.0:8116", "-s", "/var/lib/ckb-indexer/data" ]
deploy:
restart_policy:
condition: on-failure
max_attempts: 10
depends_on:
check-ckb-started-successfully:
condition: service_completed_successfully
godwoken:
image: ghcr.io/godwokenrises/godwoken:develop-smt-trie
init: true
healthcheck:
test: /var/lib/layer2/healthcheck.sh
start_period: 600s
interval: 10s
retries: 3
environment:
RUST_LOG: info,gw_generator=debug
RUST_BACKTRACE: full
STORE_PATH: /var/lib/layer2/data
ACCOUNTS_DIR: /accounts
GITHUB_RUN_ID: ${GITHUB_RUN_ID:-""}
volumes:
- ./layer2:/var/lib/layer2
- ../accounts:/accounts
ports:
- 8119:8119 # rpc
- 8120:8120 # err_receipt_ws_listen
entrypoint: "/var/lib/layer2/entrypoint.sh"
deploy:
restart_policy:
condition: on-failure
max_attempts: 10
depends_on:
postgres:
condition: service_started
ckb:
condition: service_started
ckb-miner:
condition: service_started
ckb-indexer:
condition: service_started
check-ckb-started-successfully:
condition: service_completed_successfully
godwoken-readonly:
image: ghcr.io/godwokenrises/godwoken:develop-smt-trie
healthcheck:
test: /var/lib/layer2/healthcheck.sh
start_period: 10s
interval: 30s
retries: 600
environment:
RUST_LOG: info,gw_generator=debug
RUST_BACKTRACE: full
STORE_PATH: /var/lib/layer2/data-readonly
ACCOUNTS_DIR: /accounts
GITHUB_RUN_ID: ${GITHUB_RUN_ID:-""}
volumes:
- ./layer2:/var/lib/layer2
- ../accounts:/accounts:ro
ports:
- 28119:8119 # rpc
- 28120:8120 # err_receipt_ws_listen
entrypoint: "/var/lib/layer2/entrypoint-readonly.sh"
deploy:
restart_policy:
condition: on-failure
max_attempts: 1
depends_on:
godwoken:
condition: service_healthy
web3:
image: ghcr.io/godwokenrises/godwoken-web3-prebuilds:develop
init: true
healthcheck:
test: curl http://127.0.0.1:8024 || exit 1
start_period: 10s
interval: 10s
retries: 3
volumes:
- ./layer2/config/web3-config.env:/godwoken-web3/packages/api-server/.env
- ./web3/entrypoint.sh:/var/lib/web3/entrypoint.sh
entrypoint: /var/lib/web3/entrypoint.sh
ports:
- 8024:8024
deploy:
restart_policy:
condition: on-failure
max_attempts: 10
depends_on:
ckb:
condition: service_started
ckb-miner:
condition: service_started
check-ckb-started-successfully:
condition: service_completed_successfully
godwoken:
condition: service_healthy
godwoken-readonly:
condition: service_healthy
postgres:
condition: service_started
redis:
condition: service_started
web3-indexer:
image: ghcr.io/godwokenrises/godwoken-web3-indexer-prebuilds:develop
init: true
volumes:
- ./layer2/config:/var/lib/layer2/config
- ./web3/indexer_entrypoint.sh:/var/lib/web3-indexer/entrypoint.sh
working_dir: /var/lib/web3-indexer
entrypoint: /var/lib/web3-indexer/entrypoint.sh
environment:
CONFIG_DIR: /var/lib/layer2/config
RUST_LOG: info
deploy:
restart_policy:
condition: on-failure
max_attempts: 10
depends_on:
web3:
condition: service_healthy
godwoken-readonly:
condition: service_healthy
postgres:
condition: service_started
redis:
condition: service_started