Does Discourse support multiple machines (each with a single docker container) behind a standalone load balancer?
I require a Discourse setup to handle the failure of a server, so my standard response is to configure 3 servers behind a load balancer (with the LB handling the SSL certificate).
I have configured standalone external postgres and redis servers for Discourse. (This is all on Google Cloud Platform). I am using the Discourse launcher to configure the web-only docker container.
- Does Discourse support running multiple containers when each container is on a different machine?
- Should I just copy the created docker container from the first machine to the other machines?
- How are uploaded logos handled?
- Are uploaded logos, favicons, etc stored in the database?
Many thanks for help.
Yes, that how we run it at our hosting service.
- You should configure Using Object Storage for Uploads (S3 & Clones)
- No, they go to object storage as said in 3.
Thanks Rafael. Much appreciated.
I have run into an issue with the SSL terminated on the load balancer. Discourse specifies all it’s links as HTTP.
Is there a way to make Discourse aware that it’s links should be https?
Yes, drop to a rails console and set it to https with:
./launcher enter app
SiteSetting.force_https = true
Excellent. Thanks again.
I presume that I could to the app.yml
- exec: rails c "SiteSetting.force_https = true"
I have no idea about rails. In my command above, should it be ‘rails c’ or ‘rails r’?
Yep, that is where I copied my command from.
One last question. Is the docker container monitored? If the docker container stops for any reason, has
launcher setup anything to restart it?
launcher asks Docker to autorestart the containers.
Okay. So I have now have a working discourse on a single machine. I have two other machines. The docker guest /shared volume is pointed to an NFS directory to allow all machines to access the uploads (esp. logos, etc).
I have copied the docker images to the machines 2 and 3 (
docker save -o app-image local_discourse/app and then
docker load -i app-image.
I was under the impression that a simple
./launcher start app would work, but it attempts to check containers/app.yml.
Will I run into problems if I allow the app.yml to be checked (and changes made) to the DB from machine 2 and 3?
Is there a better way to have three machines running a single setup?
I’d set ENV