Discourse in a Docker container

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

http://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container

10 Likes

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.

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?

1 Like

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.

1 Like

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

5 Likes

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

  1. Readme from https://github.com/SamSaffron/discourse_docker (and using git clone)
  2. This is how you would work through it section from Sam’s blog entry http://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container
  3. docker pull samsaffron/discourse
1 Like

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).

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?

1 Like

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.

I believe that has to do with this regression:
https://meta.discourse.org/t/sidekiq-cpu-load-since-latest-release/9515/22

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@0.0.0.0’s password:

So I cannot SSH - please advice.

1 Like

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

Hi.
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.

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.

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

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

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.

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

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.

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