-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.solt.yml
195 lines (192 loc) · 5.66 KB
/
docker-compose.solt.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
version: "3"
x-variables:
election_timeout: &election_timeout '--election-timeout=2000'
heartbeat_interval: &heartbeat_interval '--heartbeat-interval=200'
initial_cluster: &initial_cluster '--initial-cluster=etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380'
initial_cluster_state: &initial_cluster_state '--initial-cluster-state=new'
initial_cluster_token: &initial_cluster_token '--initial-cluster-token=secrettoken'
listen_peer_urls: &listen_peer_urls '--listen-peer-urls=http://0.0.0.0:2380'
listen_client_urls: &listen_client_urls '--listen-client-urls=http://0.0.0.0:2379'
peer-trusted-ca-file: &peer-trusted-ca-file '--peer-trusted-ca-file=${HOME}/solt/certs/ca.crt'
auto-tls: &auto-tls '--auto-tls'
peer-auto-tls: &peer-auto-tls '--peer-auto-tls'
common_etcd_settings: &common_etcd_settings
image: quay.io/coreos/etcd:v3.5.9
entrypoint: /usr/local/bin/etcd
environment:
- ETCD_DATA_DIR=/etcd-data
ports:
- '4001'
- '2380'
- '2379'
networks:
data_layer:
common_api_settings: &common_api_settings
environment:
- BIRDEYE_API_KEY=${BIRDEYE_API_KEY}
- SELECTED_MODE=${SELECTED_MODE}
- SELECTED_SIGNAL_GENERATOR=${SELECTED_SIGNAL_GENERATOR}
- SELECTED_SHORT_TERM_INTERVAL=${SELECTED_SHORT_TERM_INTERVAL}
- SELECTED_LONG_TERM_INTERVAL=${SELECTED_LONG_TERM_INTERVAL}
- SELECTED_TIMEFRAME=${SELECTED_TIMEFRAME}
- TOKEN_ADDRESS=${TOKEN_ADDRESS}
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}
- ETCDHOSTS=etcd0:2379,etcd1:2379,etcd2:2379
- NODE_ENV=docker
- NODE_OPTIONS="--max-old-space-size=4096"
networks:
api_layer:
data_layer:
restart: always
depends_on:
- etcd0
- etcd1
- etcd2
common_trader_settings: &common_trader_settings
<<: *common_api_settings
image: 'trader-img'
build:
context: .
dockerfile: ./trader/Dockerfile
ports:
- '1234'
healthcheck:
test: curl --fail http://localhost:1234/poll || kill 1
interval: 30s
timeout: 10s
retries: 3
common_preprocessor_setting: &common_preprocessor_settings
<<: *common_api_settings
image: 'preprocessor-img'
build:
context: .
dockerfile: ./preprocessor/Dockerfile
ports:
- '1235'
healthcheck:
test: curl --fail http://localhost:1235/poll || kill 1
interval: 30s
timeout: 10s
retries: 3
common_postprocessor_setting: &common_postprocessor_settings
<<: *common_api_settings
image: 'analyzer-img'
build:
context: .
dockerfile: ./postprocessor/Dockerfile
ports:
- '1236'
healthcheck:
test: curl --fail http://localhost:1236/poll || kill 1
interval: 30s
timeout: 10s
retries: 3
services:
soltproxy:
image: soltproxy-img
hostname: ${HOSTNAME}
build:
context: .
dockerfile: ./lb/Dockerfile.solt.lb
volumes:
- $HOME/solt/certs/haproxy:/certs
ports:
- '443:443'
networks:
api_layer:
depends_on:
- postprocessor0
- postprocessor1
- postprocessor2
trader0:
<<: *common_trader_settings
container_name: trader0
trader1:
<<: *common_trader_settings
container_name: trader1
trader2:
<<: *common_trader_settings
container_name: trader2
preprocessor0:
<<: *common_preprocessor_settings
container_name: preprocessor0
preprocessor1:
<<: *common_preprocessor_settings
container_name: preprocessor1
preprocessor2:
<<: *common_preprocessor_settings
container_name: preprocessor2
postprocessor0:
<<: *common_postprocessor_settings
container_name: postprocessor0
postprocessor1:
<<: *common_postprocessor_settings
container_name: postprocessor1
postprocessor2:
<<: *common_postprocessor_settings
container_name: postprocessor2
etcd0:
<<: *common_etcd_settings
hostname: etcd0
container_name: etcd0
command:
- '--name=etcd0'
- '--advertise-client-urls=http://etcd0:2379'
- '--initial-advertise-peer-urls=http://etcd0:2380'
- *election_timeout
- *heartbeat_interval
- *initial_cluster
- *initial_cluster_state
- *initial_cluster_token
- *listen_client_urls
- *listen_peer_urls
#- *auto-tls
#- *peer-auto-tls
volumes:
# - $HOME/solt/certs/etcd/etcd0/server.crt:/etc/ssl/certs/ca-certificates.crt
- $HOME/solt/etcd0:/etcd-data
etcd1:
<<: *common_etcd_settings
hostname: etcd1
container_name: etcd1
command:
- '--name=etcd1'
- '--advertise-client-urls=http://etcd1:2379'
- '--initial-advertise-peer-urls=http://etcd1:2380'
- *election_timeout
- *heartbeat_interval
- *initial_cluster
- *initial_cluster_state
- *initial_cluster_token
- *listen_client_urls
- *listen_peer_urls
#- *auto-tls
#- *peer-auto-tls
volumes:
# - $HOME/solt/certs/etcd/etcd1/etcd1.crt:/etc/ssl/certs/ca-certificates.crt
- $HOME/solt/etcd1:/etcd-data
etcd2:
<<: *common_etcd_settings
hostname: etcd2
container_name: etcd2
command:
- '--name=etcd2'
- '--advertise-client-urls=http://etcd2:2379'
- '--initial-advertise-peer-urls=http://etcd2:2380'
- *election_timeout
- *heartbeat_interval
- *initial_cluster
- *initial_cluster_state
- *initial_cluster_token
- *listen_client_urls
- *listen_peer_urls
#- *auto-tls
#- *peer-auto-tls
volumes:
# - $HOME/solt/certs/etcd/etcd2/etcd2.crt:/etc/ssl/certs/ca-certificates.crt
- $HOME/solt/etcd2:/etcd-data
networks:
api_layer:
driver: bridge
data_layer:
driver: bridge