Multisite configuration with Docker

docker

(blaumeer) #28

I feel naive. Of course I should do that.

As I think of it, I must change the second instance data directory to something different such as:

## These containers are stateless, all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/second
      guest: /shared
  - volume:
      host: /var/discourse/shared/second/log/var-log
      guest: /var/log

(dirkcuys) #29

Don’t worry, I would have tried that without changing the data directories :smile:


(Kane York) #30

In fact, doing that would result in the exact same messed-up data. The volume entries are the only place where the directory is referenced.


(blaumeer) #31

I tried it this morning in my setup and I confirm that two apps (app1 and app2) in /var/discourse/containers/, both behing and nginx reverse proxy, plus appropriate firewall rules, works. Thanks @riking and @dirkcuys.


(dirkcuys) #32

Hey @blau, that’s great. How did you setup the nginx proxy? Did you do that as a seperate docker container or did you setup nginx on the host system?


(blaumeer) #33

Hi @dirkcuys, I setup nginx on the host.

The only thing to pay attention is the nginx version, which must be the same on both Discourse and host. On Ubuntu 14.04 LTS I installed nginx mainline ppa to that effect.

Then I created the nginx sites as explained here (the SSL errors tipped me about the version problem when doing nginx -t).

Finally I firewalled the ports that should be accessible from localhost only (IPv4 and IPv6).

Edit: as Discourse nginx has been moved from stable (1.6) to mainline (1.7) due to a SPDY bug in stable, I have updated this message. If you use this setup, be sure to remove the stable ppa, add the mainline, and upgrade.


Enable a CDN for your Discourse
(Jeff Atwood) #34

I moved 3 posts to a new topic: Hosting wordpress, discourse, and a php app on the same server


(Bradley Boven) #35

When trying to do the multi-site install (with the additional walkthrough here), I get the following error:

I, [2014-11-10T19:31:25.978061 #41]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find minitest-5.4.2 in any of the sources (Bundler::GemNotFound)

I can’t get past this bootstrap failure. Any ideas?


(Bradley Boven) #36

After trying more things, it seems like this is perhaps specific to the multisite rake task so it might only be affecting people doing multisite installs? I’ve included more console output in case it helps:

I, [2014-11-10T21:28:57.470910 #42]  INFO -- : > echo "done configuring web"
I, [2014-11-10T21:28:57.472120 #42]  INFO -- : done configuring web

I, [2014-11-10T21:28:57.473052 #42]  INFO -- : > cd /var/www/discourse && gem update bundler
I, [2014-11-10T21:29:01.882410 #42]  INFO -- : Updating installed gems
Nothing to update

I, [2014-11-10T21:29:01.882826 #42]  INFO -- : > cd /var/www/discourse && chown -R discourse /var/www/discourse
I, [2014-11-10T21:29:03.859754 #42]  INFO -- : 
I, [2014-11-10T21:29:03.860481 #42]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find minitest-5.4.2 in any of the sources (Bundler::GemNotFound)
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/spec_set.rb:85:in `map!'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/spec_set.rb:85:in `materialize'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/definition.rb:132:in `specs'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/definition.rb:177:in `specs_for'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/definition.rb:166:in `requested_specs'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/environment.rb:18:in `requested_specs'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:13:in `setup'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler.rb:121:in `setup'
	from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/setup.rb:17:in `<top (required)>'
	from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
I, [2014-11-10T21:29:05.573532 #42]  INFO -- : 


FAILED
--------------------
RuntimeError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate failed with return #<Process::Status: pid 164 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate"
2cfd77fb3837b060ea8898c973ac19cbf4b51a57ff5f4ae0030dc52ccf523335
FAILED TO BOOTSTRAP

(Bradley Boven) #37

The multisite install still appears to be broken. Has anyone else done a multi-site install in the last two days and been successful?


(Peter Armstrong) #38

I’m having the exact same problem here.


(Sam Saffron) #39

no idea why you would be asking for minitest, that is not in production. perhaps RAILS_ENV is not set to production somehow


(Matt) #40

If Multisite install is not working properly is it possible to create a second instance of Discourse on a second droplet on Digital Ocean and just run a completely separate Discourse site?
Is that recommend? Why or why not? Would there be any potential issues when doing that?
What are the advantages of a multisite install versus setting up another instance of Discourse?

Thank you!


(Peter Armstrong) #41

I’ve changed the line it’s failing on to specify the production env
web.yml -

cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec rake multisite:migrate

Still failing with the same error that @kazzamalla is having.


(Dev) #42

I am getting the same error with multisite install. @sam @riking @jeffreycwitt Any help appreciated.

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 18546 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
aa49a364524d88f0fe53bdac9720cd214a9f9a844253714c838cff3eea3119d4
FAILED TO BOOTSTRAP

Failed bootstrapping web container (data successfully done)
Starting a second Discourse forum on the same VPS
(Dev) #43

Prior to above failed notification. I see following password authentication error message in the error log.

I, [2014-11-16T21:21:49.953195 #42]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
PG::Error: FATAL:  password authentication failed for user "discourse"
FATAL:  password authentication failed for user "discourse"

(Sam Saffron) #44

@techAPJ confirms there are issues here, unfortunately I am busy looking at customer issues and will not be able to look at this issue for at least another 14 days. PR to fix the issue or howto welcome.


(Brahn) #45

I am seeing this same error. Any help on how to fix it would be greatly appreciated. I have tried adding the RAILS_ENV=production but it doesn’t appear to change anything.

I, [2014-11-26T19:20:30.741479 #44]  INFO -- : > cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec rake multisite:migrate
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.7/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find minitest-5.4.2 in any of the sources (Bundler::GemNotFound)

(Dev) #46

@techAPJ @sam

Any updates on your plans for potential fix on multisite install?


(Mittineague) #47

Somewhat different error message, but the same problem as described here?