I’d like to create a second instance of Discourse on my server, which is completely self-contained. It will be another forum entirely.
I assume Docker helps us host setups like this, although I’m concerned to understand any potentially clashes between the two instances, if I were to add a second.
You second instance cannot have “app.yml” as the filename since it is going to be the Docker container name. You can just copy the app.yml file from the first instance and edit it to suit your configuration for 2nd one, and save it under a different filename. Then you need to ./launcher bootstrap <new app.yml file> to bring it up.
Regarding HTTP2 support, all you need is a recent enough nginx which supports HTTP2. Since now you have an external nginx, the SSL setup should be done in it instead of in the container.
You have two options to do SSL setup, if you are using Let’s Encrypt.
Setup LE outside of container. This is the approach I took. This enables you to manage the certificates from a single point. I personally prefer DNS over web server challenge validation. I have a blog post for that if you would like to give it a try.
Let the two containers handle their LE application/renew stuff the same as you have with a single container. Since you can access container files under /var/discourse/shared from the host, you can let external nginx to pick the SSL certificates there and serve HTTPS. This may require some edit in app.yml. Since I personally don’t use it so you have to figure it out by yourself.
You actually don’t need another /var/[myforum]… You can just use the same /var/discourse for multiple instances.
/var/discourse/containers/app.yml --> This is the default instance you get by running discourse-setup
/var/discourse/containers/myforum.yml --> This is the 2nd instance you get by running cp app.yml myforum.yml && edit && ./launcher bootstrap myforum
When editing myforum.yml, make sure you put a different host path under the volumes section, so that your 2nd container stores its data under a different directory than the 1st one.
thanks to you and @kraml for your work and insight on how to set up dual instances of a discourse community. usually takes me a bit to get something like this done. but now have 2 instances working behind nginx proxy. thanks to you both.
Hallo,
what is the difference between this approach and Multisite configuration with Docker?
I need a development (testing plug-ins) and production instance of discourse on Digital Ocean cloud server, that’s why I’m asking.
Multisite setup uses one database service and a shared pool of application workers for all the sites. This configuration has a completely separate database and unicorn cluster for the sites, which potentially requires a lot more RAM.