Run NodeBB in the Docker or Kubernetes
Hi all! I spent quite a lot of time to organize an automatic build of a Docker image compatible with persistent storage and k8s.
Now, it seems ready to use, you can check it on Github.
Due to one bug in the NodeBB codebase stable images currently won't run in docker, but beta tag work perfectly.
You can run the test lab using the snippet below.
docker run --name redis -d -p 6379:6379 redis docker run --name nodebb -d -p 4567:4567 \ -v /path/to/data:/data \ -e URL="http://mynodebb.com" \ -e DATABASE="redis" \ -e DB_NAME="0" \ -e DB_HOST="host.docker.internal" \ -e DB_PASSWORD="pass" \ -e DB_PORT="6379" \ nibrev/nodebb:beta
- Change /path/to/data according to the preferred location to save config.json, package.json, and uploads directory. After the first start container creates all necessary files and directories automatically, then you can edit /path/to/data/config.json and restart the container.
To update NodeBB just delete the container and run with new image version.
The difference from official NodeBB Docker image:
- Support of persistent volume to store config.json, uploads, and package.json
- Support of ENV variables to initial (auto) installation
- Runs nodebb upgrade -sb on startup
In short, realized using docker best practices so the user can easily upgrade the image without data loss and issues.
The difference from the @nilsramsperger image (superficially):
- I'm realized autobuilds, in the Github and DockerHub always an actual version of stable and beta images.
- I wasn't included in any databases in the image.
- Kubernetes compatible.
PS. This test instance still alive to test how it works in the k8s.
@rez0n I've just setup a NodeBB instance with the provided docker-compose.yml file from your repository. I've checked the log files at
/usr/src/app/logsin the nodebb image, but can't find any credentials of the admin user in the file
Do you know where I can find the credentials of the created admin account?
Just playing with NodeBB, and your work has saved me a bunch of time. Thanks a lot @dstang
For the last question, if you don't have admin password, either look for it in the log, or search for "lost admin password" in this forum.
TL;DR: there is a trick of adding a regular to "administrators" group, then use this user to reset "admin" password.