mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-09 17:23:11 +00:00
fix: use separate db (same instance) for each node
This commit is contained in:
parent
cc7ab12b42
commit
d2699e3326
@ -27,6 +27,7 @@ services:
|
||||
POSTGRES_DB: postgres
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
@ -77,7 +78,7 @@ services:
|
||||
- --rest-address=0.0.0.0
|
||||
- --rest-port=8646
|
||||
- --rest-admin=true
|
||||
- --store-message-db-url=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-test123}@postgres:5432/postgres
|
||||
- --store-message-db-url=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-test123}@postgres:5432/nwaku1
|
||||
- --log-level=${LOG_LEVEL:-INFO}
|
||||
- --max-connections=150
|
||||
|
||||
@ -126,7 +127,7 @@ services:
|
||||
- --rest-address=0.0.0.0
|
||||
- --rest-port=8647
|
||||
- --rest-admin=true
|
||||
- --store-message-db-url=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-test123}@postgres:5432/postgres
|
||||
- --store-message-db-url=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-test123}@postgres:5432/nwaku2
|
||||
- --log-level=${LOG_LEVEL:-INFO}
|
||||
- --max-connections=150
|
||||
|
||||
|
||||
8
packages/run/init-db.sh
Executable file
8
packages/run/init-db.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Create separate databases for each nwaku node
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
|
||||
CREATE DATABASE nwaku1;
|
||||
CREATE DATABASE nwaku2;
|
||||
EOSQL
|
||||
@ -27,6 +27,7 @@
|
||||
"files": [
|
||||
"dist",
|
||||
"docker-compose.yml",
|
||||
"init-db.sh",
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user