-
Notifications
You must be signed in to change notification settings - Fork 33
/
docker-compose.yaml
executable file
·305 lines (290 loc) · 8.71 KB
/
docker-compose.yaml
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
version: "3.8"
name: pocket-v1
# Make sure you have the loki driver installed. If not, just run `make docker_loki_install`
x-loki: &loki-logging
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
max-size: "5m"
max-file: "3"
keep-file: "false"
loki-external-labels: "job=pocket-nodes,container_name={{.Name}},instance={{.Name}},project=pocket-v1"
services:
client:
container_name: client
image: pocket/client:latest
build:
context: ../..
dockerfile: ./build/Dockerfile.client
environment:
# Any host that is visible and connected to the cluster can be arbitrarily selected as the RPC host
- POCKET_REMOTE_CLI_URL=http://validator1:50832
volumes:
- ${PWD}:/go/src/github.com/pocket-network
stdin_open: true
tty: true
validator1:
logging: *loki-logging
container_name: validator1
image: pocket/validator:latest
command: "build/scripts/watch.sh build/config/config.validator1.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7081" # dlv debug
- "9000"
- "42069"
- "50832"
ports:
- "${VALIDATOR1_DEBUG_PORT:-0.0.0.0:7081}:7081"
- "${VALIDATOR1_P2P_PORT:-0.0.0.0:42070}:42069"
- "${VALIDATOR1_RPC_PORT:-0.0.0.0:50832}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
environment:
- POCKET_RPC_USE_CORS=true
- LIBP2P_DEBUG=info
# Uncomment to enable the pprof server
# - PPROF_ENABLED=true
# Uncomment to enable DLV debugging
# - DEBUG_PORT=7081
validator2:
logging: *loki-logging
container_name: validator2
image: pocket/validator:latest
command: "build/scripts/watch.sh build/config/config.validator2.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7082" # dlv debug
- "42069"
- "9000"
- "50832"
ports:
- "${VALIDATOR2_DEBUG_PORT:-0.0.0.0:7082}:7082"
- "${VALIDATOR2_P2P_PORT:-0.0.0.0:42071}:42069"
- "${VALIDATOR2_RPC_PORT:-0.0.0.0:50833}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
# Uncomment to enable DLV debugging
# environment:
# - DEBUG_PORT=7082
validator3:
logging: *loki-logging
container_name: validator3
image: pocket/validator:latest
command: "build/scripts/watch.sh build/config/config.validator3.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7083" # dlv debug
- "42069"
- "9000"
- "50832"
ports:
- "${VALIDATOR3_DEBUG_PORT:-0.0.0.0:7083}:7083"
- "${VALIDATOR3_P2P_PORT:-0.0.0.0:42072}:42069"
- "${VALIDATOR3_RPC_PORT:-0.0.0.0:50834}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
# Uncomment to enable DLV debugging
# environment:
# - DEBUG_PORT=7083
validator4:
logging: *loki-logging
container_name: validator4
image: pocket/validator:latest
command: "build/scripts/watch.sh build/config/config.validator4.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7084" # dlv debug
- "42069"
- "9000"
- "50832"
ports:
- "${VALIDATOR4_DEBUG_PORT:-0.0.0.0:7084}:7084"
- "${VALIDATOR4_P2P_PORT:-0.0.0.0:42073}:42069"
- "${VALIDATOR4_RPC_PORT:-0.0.0.0:50835}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
# Uncomment to enable DLV debugging
# environment:
# - DEBUG_PORT=7084
servicer1:
logging: *loki-logging
container_name: servicer1
image: pocket/servicer:latest
command: >
sh -c '
if [ "$SERVICER1_SERVICER_ENABLED" = "true" ]; then
build/scripts/watch.sh \
build/config/config.servicer1.json \
build/config/genesis.json;
else
echo "😴 Going to sleep. Servicer is not enabled.";
fi'
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7085" # dlv debug
- "42069"
- "9000"
- "50832"
ports:
- "${SERVICER1_DEBUG_PORT:-0.0.0.0:7085}:7085"
- "${SERVICER1_P2P_PORT:-0.0.0.0:42074}:42069"
- "${SERVICER1_RPC_PORT:-0.0.0.0:50836}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
environment:
# BUG: The `SERVICER1_SERVICER_ENABLED` env var is not currnetly visible in the `command` above and needs to be investigate
- SERVICER1_SERVICER_ENABLED=true
- POCKET_RPC_USE_CORS=true
# Uncomment to enable DLV debugging
# - DEBUG_PORT=7085
fisherman1:
logging: *loki-logging
container_name: fisherman1
image: pocket/fisherman:latest
command: >
sh -c '
if [ "$FISHERMAN1_FISHERMAN_ENABLED" = "true" ]; then
build/scripts/watch.sh \
build/config/config.fisherman1.json \
build/config/genesis.json;
else
echo "😴 Going to sleep. Fisherman is not enabled.";
fi'
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7086" # dlv debug
- "42069"
- "9000"
- "50832"
ports:
- "${FISHERMAN1_DEBUG_PORT:-0.0.0.0:7086}:7086"
- "${FISHERMAN1_P2P_PORT:-0.0.0.0:42075}:42069"
- "${FISHERMAN1_RPC_PORT:-0.0.0.0:50837}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
environment:
- POCKET_RPC_USE_CORS=true
# Uncomment to enable DLV debugging
# - DEBUG_PORT=7086
db:
logging: *loki-logging
container_name: pocket-db
# image: postgis/postgis # TODO(olshansky): switch image when we start adding support for GeoZones
image: postgres:14.1-alpine
restart: always
depends_on:
- loki
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "${POSTGRES_PORT_5432:-0.0.0.0:5432}:5432"
volumes:
- ${PWD}/build/sql:/tmp/scripts
- db:/var/lib/postgresql/data
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
restart: always
depends_on:
- db
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: pgadmin4
PGADMIN_LISTEN_ADDRESS: 0.0.0.0
PGADMIN_LISTEN_PORT: 5050
volumes:
- ${PWD}/build/pgadmin/servers.json:/pgadmin4/servers.json:ro
- ${PWD}/build/pgadmin/pgpass:/pgpass
ports:
- "${PGADMIN_PORT_5050:-0.0.0.0:5050}:5050"
vm:
logging: *loki-logging
container_name: victoria-metrics
image: victoriametrics/victoria-metrics
restart: unless-stopped
ports:
- "${VICTORIA_PORT_8428:-0.0.0.0:8428}:8428"
volumes:
- vm:/storage
- ./telemetry/victoria-metrics:/configs
- /var/run/docker.sock:/var/run/docker.sock
command:
- "--storageDataPath=/storage"
- "--httpListenAddr=:8428"
- "--promscrape.config=/configs/scrape.yml"
grafana:
logging: *loki-logging
container_name: grafana
image: grafana/grafana:8.5.5
depends_on:
- "vm"
environment:
# TODO(kdas): Figure out why including these plugins on some platforms causes this error:
# `Error: ✗ Plugin not found (Grafana v8.5.2 linux-arm64)`
# - GF_INSTALL_PLUGINS="grafana-clock-panel,grafana-simple-json-datasource"
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org.
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_USERS_ALLOW_SIGN_UP=false
ports:
- "${GRAFANA_PORT_3000:-0.0.0.0:3000}:3000"
volumes:
- grafanadata:/var/lib/grafana
- ./telemetry/grafana/provisioning/:/etc/grafana/provisioning/
- ./telemetry/dashboards/:/var/lib/grafana/dashboards/
restart: unless-stopped
loki:
# logging: *loki-logging
image: grafana/loki:2.5.0
container_name: loki
expose:
- 3100
ports:
- "${LOKI_PORT_3100:-0.0.0.0:3100}:3100"
restart: unless-stopped
volumes:
- ./telemetry/loki/config.yaml:/etc/loki/local-config.yaml
- loki:/loki
volumes:
db:
driver: local
vm:
driver: local
grafanadata:
driver: local
loki:
driver: local