-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathdocker-compose.yml
197 lines (183 loc) · 6.25 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
version: "3.7"
# Environment variable definitions
x-rln-relay-eth-client-address: &rln_relay_eth_client_address ${RLN_RELAY_ETH_CLIENT_ADDRESS:-} # Add your RLN_RELAY_ETH_CLIENT_ADDRESS after the "-"
x-rln-environment: &rln_env
RLN_RELAY_CONTRACT_ADDRESS: ${RLN_RELAY_CONTRACT_ADDRESS:-0xCB33Aa5B38d79E3D9Fa8B10afF38AA201399a7e3}
RLN_RELAY_CRED_PATH: ${RLN_RELAY_CRED_PATH:-} # Optional: Add your RLN_RELAY_CRED_PATH after the "-"
RLN_RELAY_CRED_PASSWORD: ${RLN_RELAY_CRED_PASSWORD:-} # Optional: Add your RLN_RELAY_CRED_PASSWORD after the "-"
x-pg-pass: &pg_pass ${POSTGRES_PASSWORD:-test123}
x-pg-user: &pg_user ${POSTGRES_USER:-postgres}
x-pg-environment: &pg_env
POSTGRES_USER: *pg_user
POSTGRES_PASSWORD: *pg_pass
x-pg-exporter-env: &pg_exp_env
environment:
POSTGRES_PASSWORD: *pg_pass
DATA_SOURCE_URI: postgres?sslmode=disable
DATA_SOURCE_USER: *pg_user
DATA_SOURCE_PASS: *pg_pass
PG_EXPORTER_EXTEND_QUERY_PATH: /etc/pgexporter/queries.yml
# Services definitions
services:
nwaku:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:v0.34.0}
restart: on-failure
ports:
- 30304:30304/tcp
- 30304:30304/udp
- 9005:9005/udp
- 127.0.0.1:8003:8003
- 80:80 #Let's Encrypt
- 8000:8000/tcp #WSS
- 127.0.0.1:8645:8645
logging:
driver: json-file
options:
max-size: "100m"
max-file: "10"
compress: "true"
tag: "nwaku-{{.ID}}"
environment:
DOMAIN: ${DOMAIN}
NODEKEY: ${NODEKEY}
RLN_RELAY_CRED_PASSWORD: "${RLN_RELAY_CRED_PASSWORD}"
RLN_RELAY_ETH_CLIENT_ADDRESS: *rln_relay_eth_client_address
EXTRA_ARGS: ${EXTRA_ARGS}
STORAGE_SIZE: ${STORAGE_SIZE}
<<:
- *pg_env
- *rln_env
volumes:
- ./run_node.sh:/opt/run_node.sh:Z
- ${CERTS_DIR:-./certs}:/etc/letsencrypt/:Z
- ./rln_tree:/etc/rln_tree/:Z
- ./keystore:/keystore:Z
entrypoint: sh
command:
- /opt/run_node.sh
depends_on:
- postgres
# TODO: Commented until ready
#waku-frontend:
# # TODO: migrate to waku-org
# image: docker.io/alrevuelta/waku-frontend:latest
# #command:
# # - xxx
# ports:
# - 127.0.0.1:4000:3000
# restart: on-failure:5
# depends_on:
# - nwaku
prometheus:
image: docker.io/prom/prometheus:latest
volumes:
- ./monitoring/prometheus-config.yml:/etc/prometheus/prometheus.yml:Z
command:
- --config.file=/etc/prometheus/prometheus.yml
# ports:
# - 127.0.0.1:9090:9090
restart: on-failure:5
depends_on:
- postgres-exporter
- nwaku
grafana:
image: docker.io/grafana/grafana:latest
env_file:
- ./monitoring/configuration/grafana-plugins.env
volumes:
- ./monitoring/configuration/grafana.ini:/etc/grafana/grafana.ini:Z
- ./monitoring/configuration/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:Z
- ./monitoring/configuration/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml:Z
- ./monitoring/configuration/dashboards:/var/lib/grafana/dashboards/:Z
- ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_icon.svg:Z
- ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_typelogo.svg:Z
- ./monitoring/configuration/customizations/custom-logo.png:/usr/share/grafana/public/img/fav32.png:Z
ports:
- 0.0.0.0:3000:3000
restart: on-failure:5
depends_on:
- prometheus
postgres:
# This service is used when the Waku node has the 'store' protocol enabled
# and the store-message-db-url is set to use Postgres
image: postgres:15.4-alpine3.18
restart: on-failure:5
shm_size: '1g' # Set shared memory size to 1 GB
environment:
<<: *pg_env
volumes:
- ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z
- ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z
- ${PG_DATA_DIR:-./postgresql}:/var/lib/postgresql/data:Z
command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports:
- 127.0.0.1:5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
postgres-exporter:
# Service aimed to scrape information from Postgres and post it to Prometeus
image: quay.io/prometheuscommunity/postgres-exporter:v0.12.0
restart: on-failure:5
<<: *pg_exp_env
volumes:
- ./monitoring/configuration/postgres-exporter.yml:/etc/pgexporter/postgres-exporter.yml:Z
- ./monitoring/configuration/pg-exporter-queries.yml:/etc/pgexporter/queries.yml:Z
command:
# Both the config file and 'DATA_SOURCE_NAME' should contain valid connection info
- --config.file=/etc/pgexporter/postgres-exporter.yml
depends_on:
- postgres
waku-frontend:
# TODO: migrate to waku-org
image: alrevuelta/waku-frontend:aad9628
ports:
- 127.0.0.1:4000:4000
restart: on-failure:5
depends_on:
- nwaku
## Remove comment if you need pgadmin support in your container.
## Commented for backward version compatibility of docker-compose.
# pgadmin:
# image: dpage/pgadmin4:latest
# environment:
# - PGADMIN_DEFAULT_PASSWORD=wakuwaku
# - PGADMIN_CONFIG_SERVER_MODE=False
# - PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
# - PGADMIN_LISTEN_PORT=80
# ports:
# - 15432:80
# user: root
# entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;"
# volumes:
# - pgadmin:/var/lib/pgadmin
# configs:
# - source: servers.json
# target: /pgadmin4/servers.json
# - source: pgpass
# target: /pgpass
# depends_on:
# - postgres
# profiles:
# - dbadmin
# volumes:
# pgadmin:
# configs:
# pgpass:
# content: postgres:5432:*:${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-test123}
# servers.json:
# content: |
# {"Servers": {"1": {
# "Group": "Servers",
# "Name": "WakuStoreDB",
# "Host": "postgres",
# "Port": 5432,
# "MaintenanceDB": "postgres",
# "Username": "postgres",
# "PassFile": "/pgpass",
# "SSLMode": "disable"
# }}}