Multisite configuration with Docker

docker

(Sam Saffron) #48

I corrected the initial post, it is now up to date with a working example which I just tested.


(Arpit Jalan) #49

Just deployed a fresh multisite instance, confirmed it’s working fine after following updated first post. :+1:


(Dev) #50

Thank you very much @sam and @techAPJ


#51

I did multisite configuration, now I have some questions:

  1. How does it affect performance? I am using 1CPU + 1GB RAM minimum set up(DigitalOcean), and I made an multisite with this instruction. Now I have two Discourse sites on the same server, but I feel it got much slower than before.

  2. I did /admin/upgrade but the progress bar didn’t work. So I thought something’s wrong but I got my sites upgraded successfully anyway.

  3. If you can give an extra example of third site configuration(not just second), it will be helpful. (I don’t need third site, but I want to learn)


#52

More detail and self research …

  1. How does it affect performance? I am using 1CPU + 1GB RAM minimum set up(DigitalOcean), and I made an multisite with this instruction. Now I have two Discourse sites on the same server, but I feel it got much slower than before.

I don’t know about performance well, but I just heard multisite is just making 1 more DB and it doesn’t affect performance? Then why did it get slower? Maybe the recent update cause it? ( … also it seems rebuilding is taking more time than before.)

  1. I did /admin/upgrade but the progress bar didn’t work. So I thought something’s wrong but I got my sites upgraded successfully anyway.

It didn’t work really, nothing displayed in console. But it is working well again. I don’t know why.


(Kane York) #53

Yeah, it’s recent changes, soon there will be a rebuild which gets rid of the slow and replaces it with the fast.


#54

Thank you for the explanation. So, making multisites doesn’t affect the server performance?


(dirkcuys) #55

Hey @matt5834 - fancy meeting you here. I think the only thing to consider with running a seperate droplet is costs and maintaining a separate server. Probably fine if you want two forums, but can get out of hand if you have many!


(Brahn) #56

Should this maybe be:
- su discourse -c 'git clone https://github.com/discourse/docker_manager.git'

I noticed that when I add more plugins they would fail to clone and finally twigged that it is because this is now using the before_bundle_exec hook rather than after_code as mentioned in the web_only.yml sample and in other guides and that before_bundle_exec hook is after a chown -R discourse $home. Right? :smile:

Also, is the mkdir -p plugins really necessary? As best I understand this creates a new directory under plugins so you end up with $home\plugins\plugins


(dirkcuys) #57

Hey @sam - I also noticed some problems wrt running

after_bundle_exec:
  - exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate

Are there other stuff that needs updating?


(Sam Saffron) #58

The template is migrating too early, see the revised:


Runabove (OVH Experiment) vs Digital Ocean
(Frédéric) #59

Hello,

As a newbie, I try to find my config way. I had no trouble with Docker install tutorial and I thank you for that.

But I cannot here understand what I have to do to configure two websites, sorry.

Here is what I’ve done :

  • Install Ubuntu 14.04
  • Install Docker : sudo wget -qO- https:// get.docker.io/ | sh
  • Install Discourse :
  • sudo mkdir /var/discourse
  • sudo git clone https:// GitHub - discourse/discourse_docker: A Docker image for Discourse /var/discourse
  • cd /var/discourse
  • Now begins multisite tutorial :
  • sudo cp samples/standalone.yml containers/app.yml
  • sudo nano containers/app.yml, changing config as required and replace the entire hook section
  • Now what ?

As I can understand, I have to cp and personnalize multisite.yml that I have found here :
https://raw.githubusercontent.com/discourse/discourse/master/config/multisite.yml.production-sample

But I don’t know how :fearful:

Plan B could be to install each websites on dedicated VMs (really cheap on runabove.com). Perhaps I would bet less trouble ?

Thanks for all again ! I discover a wonderland here :slight_smile:


(dirkcuys) #60

Thanks, didn’t notice before that the names for the hooks changed. It’s working now!


(Frédéric) #61

MULTISITE WORKS ! :smiley:

In fact, this tutorial is for standalone multisite, and I was afraid by this warning:

We strongly recommend you run separate web and data containers

I was trying to install on the same time both multisite and on separate containers. It was confusing.

So now, I will try to understand how to install discourse on two containers :smile:

I have found this tutorial, but It appears to be offline. Is it safe trying to follow this way ?

Beginner’s guide to setting up discourse multisite with docker
http://webcache.googleusercontent.com/search?q=cache:uPusvtbHYgoJ:https://meta.discourse.org/t/beginners-guide-to-setting-up-discourse-multisite-with-docker/17972+&cd=2&hl=fr&ct=clnk&gl=fr

Can anyone point me to the right tutorial ? Perhaps this one ?

Running a separate data container

Thanks for all !


(Sam Saffron) #62

Sure, go to post #1 in this topic


(Frédéric) #63

Hello,
I’ve tried to separate web and data containers, but not successfully :frowning: It’s very difficult, and error messages are quiet obscure.

I have understand that you strongly recommend to separate containers, but can anyone explain a little more what happens if we don’t ? Many thanks again


Contabo experience with Plesk, Webmin or other server-admin setup?
(Kane York) #64

Not much happens, you just get slightly longer down times when you rebuild. Not that bad.


Contabo experience with Plesk, Webmin or other server-admin setup?
(Sigurður Guðbrandsson) #65

Updated the wiki article for the new docker hooks and descriptions.

The hook before_bundle_exec should not be used. after_code should be used in stead.

Adding plugins with the hook before_bundle_exec causes build errors due to the fact that both hooks run as the root user, but the chown command runs after after_code but before before_bundle_exec.

This causes plugins that are git cloned in the before_bundle_exec hook cause the build to fail (see how it happens here).

Also, changed /var/www/discourse to $home so it looks more like the current yml description files.


(eriko) #66

Could someone explain the ‘|’ in the above? I think that is it checking to see if the following is in the multisite.yml file. I am in the process making a script in the data container to read that file and create missing databases and would like to better understand what is currently happening.

Thanks


(Sigurður Guðbrandsson) #67

This is a functionality in PUPS to append the following to the file contents.

In essence, this says “add everything behind | to $home/config/multisite.yml”