NodeBB Docker Image for Testing
-
Hey everyone,
I'm glad to see another high quality project by fellow Node devs. For quick testing of a project with dependencies like databases, etc, the first place I check is Docker Hub. Its much easier to pull down a preconfigured image and start with that.
Nothing appeared during my search, so I went ahead and put a Dockerfile together and pushed it for anyone else who might find it useful:
Starting Up
In your linux host vm (virtualbox/parallels/vmware/digital ocean droplet), run commands:
docker pull kindwave/nodebb
docker run -i -t -p 4567:4567 kindwave/nodebb*This should bring up the standard NodeBB command prompt questions about port number, redis, etc. The only port exposed by the Docker container is 4567 so I'd leave everything as default. *
Once you choose an admin username, password and email you'll be back at an ubuntu bash prompt like:
root@44e4bc5d35d3:/src/nodebb#Type:
forever start app.jsYou should have a default NodeBB instance running now.
Docker Quickstart with boot2docker (VirtualBox)
Anyone wondering how to get started with Docker can check out: https://github.com/boot2docker/boot2docker
for a quick Linux Host VM + Docker installer.One gotcha with VirtualBox (on a Mac host at least) is that port forwarding from the Docker container didn't seem to propagate through to the Mac by default.
You want to be able to run http://localhost:4567 in your Mac/Windows browser to test and by default VirtualBox won't make the connection. This should fix it, but YMMV:
VBoxManage controlvm boot2docker-vm natpf1 "name,tcp,127.0.0.1,4567,,4567"
I'd highly recommend Parallels or VMWare Fusion as a VM Host (with Ubuntu as the "Host" OS for example).
More info on Docker here:
https://docs.docker.com/reference/commandline/cli/Cheers!
-
Awesome This would look great over on our docs, feel free to copy your post over there, we would greatly appreciate it
-
Cool! I was about to write a new thread asking for an official Docker image.
-
This post is deleted!