@mschwartz one of the issues with migration to TS is the plugin system. NodeBB is using some of the flexibility of CommonJS that becomes a liability when adding server-side builds. Plugins use require.main.require, and I'm honestly not sure how well this works with TypeScript - it definitely doesn't work with IntelliSense (so plugins wouldn't even get the typing by default unfortunately), but I don't remember if I was testing tsc when I looked into using ES6 imports and building server-side code...
It'd be relatively simple to go Svelte way and use JSDoc for type checking with TS but without compilation though, just some work on adding the types and fixing issues found that way 🙂 Still, one would need some more work for it to help plugin developers and not just core.
(a development post by a contributor, not a team member 🙂 )
NodeBB currently works with docker... technically.
I mean, the default image is fine if you set it up correctly - but that's a pretty big if and there wasn't any good documentation. The existing docker-compose file had some tiny pain points like:
not exposing any ports by default
it recommends setting up a reverse proxy like traefik, which can be a good idea and avoids a small docker security footgun (ports exposed by containers can bypass some firewall configurations, e.g. ufw)
but also means that running docker compose up just starts up a container you can't connect to by default! You'll need to modify the config, whether you want to expose a port or set up Traefik...
not setting up volumes
I hope you like redoing all your configuration when updating the image!
also, hope you installed some plugin for storing uploads remotely, since even they'll be gone when you delete and recreate the container
you can also, again, edit it to resolve that issue
not creating any database in the mongodb container
using admin works, but is really not intuitive!
And when I said the image was fine, I mean that it's acceptable, not that it's great. It always builds NodeBB before startup, installing and activating plugins in a way that will persist properly requires using arcane configuration options that are not mentioned in the docs (and it results in not being able to install or remove any plugins at runtime), and - again - setting up volumes is entirely up to the user.
Running docker compose --profile mongo up is now all you need to start a working instance of NodeBB in a container. Initially it'll launch the web installer, with already populated database configuration, leaving you just to set up the NodeBB URL and admin account. Then just waiting a bit for setup to finish and you're done - NodeBB is running under port 4567. You can now use some reverse proxy on host, modify the compose file to expose it under port 80 or add a containerized reverse proxy and remove the default port binding.
If you use the default compose file you'll notice that configuration and - more importantly - uploads are now mounted in .docker directory, so they'll persist when recreating the container
There are some additional env variables that can affect the image startup behavior - e.g. you can now choose if NodeBB will run a build before starting.
There's another nice change that you might've thought of if you saw the initial PR title - docker image size. And it's a fairly large difference. Some numbers:
current image: 601MiB compressed/1.62GiB uncompressed
original alpine PR: 315MiB compressed/986MiB uncompressed
new PR (slim debian build): 211MiB compressed/674MiB uncompressed
For reference, now the official MongoDB image is actually larger than NodeBB, and combined (even with redis added to the mix) they're still e.g. almost 2x smaller than Discourse slim image (747MiB compressed/2.02GiB uncompressed).
And MongoDB is the largest of the supported databases - Postgres clocks at only 150MiB compressed and offers a 94MiB compressed alpine version, and Redis clocks in at 49MiB compressed for a debian image and just 15MiB for alpine.
The result is that when running NodeBB with postgres the images will end up taking less than 1GB of disk space, basically half of what they do currently. All while offering much better user experience and configurability.
And finally, Docker is graduating to being mentioned in official docs with NodeBB/docs#78 🙂