Docker compose
-
hi, i would like to install nodebb with mongo db on docker via docker-compose. I don't find any working example, I always get connection refused http://127.0.0.1:27017 ... has anyone created a docker compose to share? Thank you
-
@daniel-coscione It seems the default docker-compose was made to use another container for routing - it uses
expose
for port4567
, which means it will be accessible to other containers but not the host machine.If you want to use local nginx (without containerizing it) or another reverse proxy you can add this to nodebb service configuration:
ports: - '127.0.0.1:4567:4567'
If you want to use a containerized reverse proxy instead then you'll need to add it as a service to docker-compose. For example you can look at this guide to set up Traefik: https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/ (just note that you'll need to add
traefik.http.services.nodebb.loadbalancer.server.port=4567
label to nodebb service since that is the port NodeBB will be listening on). They also have some docker-compose exmaples with TLS from Letsencrypt.While it's not a good idea, you can also expose NodeBB by itself by just using the same ports directive as with local reverse proxy, but without binding to localhost:
ports: - '4567:4567'
-
A pretty good Docker-compose.yml file on this page.
https://hub.docker.com/r/nibrev/nodebb
It uses redis, but it should be easy to modify it to use mongodb…
I would use a better NodeBB Docker image though.
-
@mschwartz Do you have any suggestions for a better NodeBB Docker image?
I see the one from ghcr.io/rez0n/nodebb:latest is v1.19.1 (latest v3.4.2)..
Thanks!
-
@schwach I have two installations dependent on this image and I am stuck as there are no updates for a while, i wouldn't advise using it.
I'm still looking for an efficient way to setup a docker-compose file that can be used to update with new release (both nodebb and mongodb). I wish updating nodebb was much simpler, i have an old forum started from 1.7, it has been such a pain keeping it up to date because of the need of dependencies.