Discourse in a Docker container

(Sam Saffron) #1

FYI I just posted a blog post about my Docker adventures:


(Erlend Sogge Heggen) #2

I wonder how it compares against Rubber. Any huge differences? Did @supermathie test that one as well?

Anyhow, wonderful news! Really looking forward to install Discourse all by my lonesome, no friends required.

(Erlend Sogge Heggen) #3

It seems you’re frequently recommending people to use the Docker installer as opposed to following the default Ubuntu Install Guide now. Time for Docker to ascend the throne as Default Install Guide perhaps?

(Sam Saffron) #4

Possibly, we have been running it in production and on multiple sites now for over a month.

I only enjoy supporting docker stuff, otherwise there are just too many variables.

(Jeff Atwood) #5

A few notable things missing before that can happen

  • Sam’s guide on how to upgrade non-Docker instances to Docker here on meta

  • Blog post on blog.discourse.org blessing Docker as our preferred setup method, explaining why, answering top 5 FAQs about it, and pointing to a newly edited install doc on github that reflects this

(Anton) #6

What’s the current recommended way to use Docker for Discourse?

  1. Readme from GitHub - discourse/discourse_docker: A Docker image for Discourse (and using git clone)
  2. This is how you would work through it section from Sam’s blog entry Discourse in a Docker container
  3. docker pull samsaffron/discourse

(Anton) #7

Just as a note, I’ve tried Docker #1 (i.e. Sam’s GitHub readme file) on top of a fresh $5 DigitalOcean VPS (the smallest one). Watching htop: ~80% of the time my CPU is 100% busy with sidekiq, memory usage 450MB out of 490MB. Is this because of Docker or just because of the nature of the environment Discourse is built on? (i.e. ruby, so there is just some minimal requirement that should be always met no matter whether any kind of virtualization is used or not).

(Sam Saffron) #8

That would be a regression we had this week, bootstrap again with latest

The instructions on guthub are the most up to date

I would avoid any vps with less than a gb of ram

How was the install process?

(Anton) #9

Sorry, I’m confused - what do you mean?

It was easy enough and with no errors. Probably more questions might come later when I try to use it - thanks.

(Ben T) #10

I believe that has to do with this regression:

(Anton) #11

So if I understand correctly I just have to update my Discourse. But how would I do it with a Docker installation from cli? Please advice.

After first bootstrap & run, I couldn’t access via ssh, so I’ve generated an ssh key in the host machine under root and added it to containers/app.yml:

ssh_key: ssh-rsa AAAAB3NzaC1…

I’ve tried ./launcher stop, bootstrap, start and when I ./launcher ssh app, it still asks for a password:

root@’s password:

So I cannot SSH - please advice.

(Sam Saffron) #12

You must destroy the old container to upgrade, see the upgrading discourse instructions in the readme

(Sedrickcz) #13

I installed docker discourse on my ubuntu 12.04 and I want access my container via ssh.
I did everything what is written here: GitHub - discourse/discourse_docker: A Docker image for Discourse
and if I bootstrap my app I have this error:

"echo ssh-rsa fsfdsfdsfd ....... root's key >> /root/.ssh/authorized_keys sh: 1: Syntax error: Unterminated quoted string"

What should I do? I tried quote my ssh key in containers/app.yml and still error.

Thank you.

(Kane York) #14

Pretty sure that’s where the unterminated quote is coming from. I think you were supposed to replace root's key, not leave it in.

(Sam Saffron) #15

Yeah, where is this root's key coming from? why was it added?

(Sedrickcz) #16

Ohh, right :slight_smile: I copied whole key from id_rsa.pub with it’s description .)

(Sedrickcz) #17

Hi I made some changes inside docker container. Add additional text field for user and some little stuffs. And I committed and I want to display the changes in production. But nothing happens. I tried to restart docker, but nothing. Any help? Thank you.

(Sam Saffron) #18

All changes need to come from the outside, I strongly recommend against changing stuff inside containers, next time you bootstrap they will be gone.

FYI to restart stuff inside a container use sv

sv stop unicorn
sv start unicorn 
sv stop sidekiq 
sv start sidekiq

(Sedrickcz) #19

Ok, thanks.

And what is your recommendation how can I add a new column to db and updates handlebars? I have to fork it or is there any easy way? Thank you.

(Sam Saffron) #20

Ideally, you create a plugin and source that plugin during bootstrap (same as we do for the discourse_docker plugin in the template)

Otherwise, fork is your only correct option