I've been trying to find an easy-to-set-up forum solution that I can stand up using docker compose, and I think I hit on an okay one. It's still more steps than I'd prefer, but in case y'all are interested, here's how you can set up a NodeBB forum like I did. The steps are all lifted from what I posted on the NodeBB Community forum.
# Make and navigate to the directory where you want all the files to live.
mkdir -p /your/nodebb/path/here
cd /your/nodebb/path/here
# Clone git repo
git clone https://github.com/NodeBB/NodeBB.git
# Move into the NodeBB directory it made.
cd NodeBB
# Copy the .docker directory and its contents to the parent directory.
# For some reason, Docker kept complaining that it couldn't mount
# my volumes because it was expecting different ones within the NodeBB
# directory and also its parent directory. This solved the issue for me.
cp -r .docker/ /your/nodebb/path/here/
Then I modified the docker-compose.yml file to remove all redis and postgres items, leaving me with the following. Note that I had to change the host ports for both the nodebb and mongo services, since I already had services running on those ports; if that doesn't apply to you, your life will be a little easier by just making them '4567:4567' and '27017:27017' respectively.
services:
nodebb:
image: ghcr.io/nodebb/nodebb:4.15.1
restart: unless-stopped
ports:
- '4568:4567' # already had something on port 4567, so I had to change it
volumes:
- nodebb-build:/usr/src/app/build
- nodebb-uploads:/usr/src/app/public/uploads
- nodebb-config:/opt/config
- ./install/docker/setup.json:/usr/src/app/setup.json
mongo:
image: 'mongo:7-jammy'
restart: unless-stopped
ports:
- '27018:27017' #already had something on port 27017, so I had to change it
environment:
MONGO_INITDB_ROOT_USERNAME: nodebb
MONGO_INITDB_ROOT_PASSWORD: nodebb
MONGO_INITDB_DATABASE: nodebb
volumes:
- mongo-data:/data/db
- ./install/docker/mongodb-user-init.js:/docker-entrypoint-initdb.d/user-init.js
volumes:
mongo-data:
driver: local
driver_opts:
o: bind
type: none
device: ./.docker/database/mongo/data
nodebb-build:
driver: local
driver_opts:
o: bind
type: none
device: ./.docker/build
nodebb-uploads:
driver: local
driver_opts:
o: bind
type: none
device: ./.docker/public/uploads
nodebb-config:
driver: local
driver_opts:
o: bind
type: none
device: ./.docker/config
Start it up using your preferred method (e.g. docker compose up -d or use Komodo like I do).
From there, I was able to access the web installer page and make my admin account. Even though I changed the host port of mongo to 27018, I had to leave the port in the web installer as 27017 for it to install correctly.