Two Discourse installation in one Virtual Machine?

(Renis) #1

Is possible to have two different Discourses in one virtual Machine?  If, yes, any short configuration!

Thank you!

(Gabriel Mazetto) #2

You can always install more then one “Rails app” on the same machine.

(Jeff Atwood) #3

Actually that post was wildly out of date (Feb 2013) so I removed it.

It is unclear what @renis is asking about, but you can definitely have multiple Docker containers hosting Discourse instances on the same server. See the advanced part of our install guide.

There is also Docker multisite.

(Renis) #4

Thank you!

I’m reading the Docker Multisite, but didn’t understand how to…

So do i have to bootstap another app for the second Discourse? or instead of standalone, i have to use web_only ?


(Renis) #5

Can you paste a multiple container configuration sample!

Thanks again!

(Sam Saffron) #6

Look at the samples folder: discourse_docker/samples at master · discourse/discourse_docker · GitHub

(Hristo Stefanov) #7

Hi, Sam. There is not a multisite example in the link you mention above. Is there another place where I could see a multisite example? I am trying to set up two Discourse instances on one server which will serve each instance through different ports.

Thank you for your help.


(Sam Saffron) #8

Try searching for “multisite howto” :slight_smile:

(Kai Liu) #9

You just have to understand one thing then multi-site is going to be quite simple:

Each yml file under /var/discourse/containers represents a docker container - create one yml with proper configuration, /var/discourse/launcher bootstrap on it, then a new instance is created.

After the regular discourse-setup steps, by default you get a app.yml which describes the first discourse docker container. You can then copy it and modify the setting as you wish, bootstrap it to get the second discourse instance. Of cause you need it to run on a different port than the 1st one.

Then you can setup an system nginx to direct traffic to those instances. There are also existing howtos for this.

For example, I have three containers running in one VM, i.e. three yml files under /var/discourse/containers:

  • Test instance, just the regular settings, with minimum resources allocated. This is for test purpose, such as upgrade to a new version, try out plugins/customizations etc…

  • DB instance, running pg for production forum.

  • Web instance, running the web part of the production forum.