diff --git a/ADVANCED.md b/ADVANCED.md index 21faf2c..b2bfca5 100644 --- a/ADVANCED.md +++ b/ADVANCED.md @@ -51,3 +51,19 @@ proofs, hashing, Merkle tree, Blockchain, etc. Deeper technical details can be found in: * [RLN-V1 spec](https://rfc.vac.dev/spec/32/) * [RLN-V2 spec](https://rfc.vac.dev/spec/58/) + +## DB Administration + +In case compositon is started with command +```console +docker compose --profile dbadmin up -d +``` +an additional service - pgadmin - is started and can be accessed from browser on http://localhost:15432 +That will give insights on the Node's message store database. + +### Shutting down the container with pgadmin service + +If started with 'dbadmin' profile it must be used when stopping it: +```console +docker compose --profile dbadmin down +``` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b838154..e895e79 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -141,3 +141,46 @@ services: - --config.file=/etc/pgexporter/postgres-exporter.yml depends_on: - postgres + + pgadmin: + image: dpage/pgadmin4:latest + environment: + - PGADMIN_DEFAULT_EMAIL=waku@waku.com + - 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" + }}} \ No newline at end of file