forked from pokt-network/pocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
executable file
·240 lines (227 loc) · 6.77 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
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
- RPC_HOST=node1.consensus
volumes:
- ${PWD}:/go/src/github.com/pocket-network
stdin_open: true
tty: true
node1.consensus:
logging: *loki-logging
container_name: node1.consensus
image: pocket/consensus:latest
command: "build/scripts/watch.sh build/config/config1.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7080" # dlv debug
- "9080"
- "9000"
- "42069"
- "50832"
ports:
- "${NODE1_PORT_7081:-0.0.0.0:7081}:7081"
- "${NODE1_PORT_9081:-0.0.0.0:9081}:9080"
- "${NODE1_PORT_42070:-0.0.0.0:42070}:42069"
- "${NODE1_PORT_50832:-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
# Uncomment to enable the pprof server
# - PPROF_ENABLED=true
# Uncomment to enable DLV debugging
# - DEBUG_PORT=7081
node2.consensus:
logging: *loki-logging
container_name: node2.consensus
image: pocket/consensus:latest
command: "build/scripts/watch.sh build/config/config2.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7082" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE2_PORT_7081:-0.0.0.0:7082}:7081"
- "${NODE2_PORT_9081:-0.0.0.0:9082}:9080"
- "${NODE2_PORT_42070:-0.0.0.0:42071}:42069"
- "${NODE2_PORT_50832:-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
node3.consensus:
logging: *loki-logging
container_name: node3.consensus
image: pocket/consensus:latest
command: "build/scripts/watch.sh build/config/config3.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7083" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE3_PORT_7081:-0.0.0.0:7083}:7081"
- "${NODE3_PORT_9081:-0.0.0.0:9083}:9080"
- "${NODE3_PORT_42070:-0.0.0.0:42072}:42069"
- "${NODE3_PORT_50832:-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
node4.consensus:
logging: *loki-logging
container_name: node4.consensus
image: pocket/consensus:latest
command: "build/scripts/watch.sh build/config/config4.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7084" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE4_PORT_7081:-0.0.0.0:7084}:7081"
- "${NODE4_PORT_9081:-0.0.0.0:9084}:9080"
- "${NODE4_PORT_42070:-0.0.0.0:42073}:42069"
- "${NODE4_PORT_50832:-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
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