Hi all! Super excited to give nodebb a try.
I'm trying to set up nodebb using docker compose and Postgres as my database. However, I always encounter the "There was an error connecting to your database. Please try again." error when trying to setup using the NodeBB installer.
The logs read
2024-03-08 14:05:21 Welcome to NodeBB v1.19.7!
2024-03-08 14:05:21
2024-03-08 14:05:21 This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
2024-03-08 14:05:21 Press enter to accept the default setting (shown in brackets).
2024-03-08 14:05:21 2024-03-08T06:05:21.169Z [30] - info: [install/checkSetupFlagEnv] checking env vars for setup info...
2024-03-08 14:05:21 2024-03-08T06:05:21.209Z [30] - info:
2024-03-08 14:05:21 Now configuring postgres database:
2024-03-08 14:05:21 2024-03-08T06:05:21.217Z [30] - warn: NodeBB Setup Aborted.
**2024-03-08 14:05:21 Error: connect ECONNREFUSED 127.0.0.1:5432**
2024-03-08 14:05:21 at /usr/src/app/node_modules/pg-pool/index.js:45:11
2024-03-08 14:05:21 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-03-08 14:05:21 at async postgresModule.init (/usr/src/app/src/database/postgres.js:54:17)
2024-03-08 14:05:21 at async completeConfigSetup (/usr/src/app/src/install.js:201:2)
2024-03-08 14:05:21 at async setupConfig (/usr/src/app/src/install.js:186:2)
2024-03-08 14:05:21 at async install.setup (/usr/src/app/src/install.js:562:3)
2024-03-08 14:05:21 at async Object.setup (/usr/src/app/src/cli/setup.js:23:15)
My current dockercompose file reads
version: '3.9'
services:
nodebb:
image: nodebb/docker
restart: unless-stopped
environment:
- DATABASE_URL=postgres://postgres:password@db:5432/postgres
volumes:
- ./data/nodebb:/data
ports:
- "4567:4567"
db:
image: postgres
restart: always
# set shared memory limit when using docker-compose
shm_size: 128mb
# or set shared memory limit when deploy via swarm stack
volumes:
- './data:/data/db'
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
expose:
- "5432"
ports:
- "5432:5432"
adminer:
image: adminer
restart: always
ports:
- 8080:8080
This is the DB configuration on the setup page:
If anyone with docker knowledge can help, it'd be great!!