forked from bnb-chain/node-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-stack.yml
More file actions
175 lines (167 loc) · 4.15 KB
/
docker-stack.yml
File metadata and controls
175 lines (167 loc) · 4.15 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
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
version: '3.8'
services:
genesis:
image: genesis-builder:local
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
restart_policy:
condition: none
volumes:
- type: bind
source: ./genesis-out
target: /workspace/genesis-out
environment:
- PASSED_FORK_DELAY=60
networks:
- spc-network
spc-validator-1:
image: ghcr.io/simplechain-org/simplechain-v2:latest
hostname: ecs-7dff-0001
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
restart_policy:
condition: on-failure
user: root
entrypoint: ["/bin/bash"]
command:
- "-c"
- |
# Copy and execute swarm init script
cp /scripts/docker-swarm-init.sh /usr/local/bin/
chmod +x /usr/local/bin/docker-swarm-init.sh
exec /usr/local/bin/docker-swarm-init.sh
environment:
- NODE_TYPE=validator
- VALIDATOR_INDEX=0
configs:
- source: docker-swarm-init
target: /scripts/docker-swarm-init.sh
- source: docker-entrypoint
target: /entrypoint/docker-entrypoint.sh
- source: node-config
target: /home/sipc2/config/config.toml
- source: genesis-json
target: /home/sipc2/config/genesis.json
- source: validator0-keys-tar
target: /tmp/keys.tar.gz
secrets:
- source: password
target: /tmp/password.txt
- source: validator0-nodekey
target: /tmp/nodekey
volumes:
- validator1-data:/data
ports:
- target: 8545
published: 8645
protocol: tcp
mode: host
- target: 8546
published: 8646
protocol: tcp
mode: host
- target: 30303
published: 31303
protocol: tcp
mode: host
- target: 30303
published: 31303
protocol: udp
mode: host
networks:
- spc-network
spc-validator-2:
image: ghcr.io/simplechain-org/simplechain-v2:latest
hostname: ecs-7dff-0002
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == worker
restart_policy:
condition: on-failure
user: root
entrypoint: ["/bin/bash"]
command:
- "-c"
- |
# Copy and execute swarm init script
cp /scripts/docker-swarm-init.sh /usr/local/bin/
chmod +x /usr/local/bin/docker-swarm-init.sh
exec /usr/local/bin/docker-swarm-init.sh
environment:
- NODE_TYPE=validator
- VALIDATOR_INDEX=1
configs:
- source: docker-swarm-init
target: /scripts/docker-swarm-init.sh
- source: docker-entrypoint
target: /entrypoint/docker-entrypoint.sh
- source: node-config
target: /home/sipc2/config/config.toml
- source: genesis-json
target: /home/sipc2/config/genesis.json
- source: validator1-keys-tar
target: /tmp/keys.tar.gz
secrets:
- source: password
target: /tmp/password.txt
- source: validator1-nodekey
target: /tmp/nodekey
volumes:
- validator2-data:/data
ports:
- target: 8545
published: 8745
protocol: tcp
mode: host
- target: 8546
published: 8746
protocol: tcp
mode: host
- target: 30303
published: 32303
protocol: tcp
mode: host
- target: 30303
published: 32303
protocol: udp
mode: host
networks:
- spc-network
networks:
spc-network:
driver: overlay
attachable: true
volumes:
validator1-data:
validator2-data:
configs:
docker-swarm-init:
file: ./docker-swarm-init.sh
docker-entrypoint:
file: ./docker-entrypoint.sh
node-config:
file: ./config.toml
genesis-json:
file: ./genesis-out/genesis.json
validator0-keys-tar:
file: ./keys/validator0-keys.tar.gz
validator1-keys-tar:
file: ./keys/validator1-keys.tar.gz
secrets:
password:
file: ./keys/password.txt
validator0-nodekey:
file: ./keys/validator-nodekey0
validator1-nodekey:
file: ./keys/validator-nodekey1