Loomio
Fri 12 Apr 2019 11:21AM

Struggling with Docker, is there another way?

N Naomi Public Seen by 69

I have been trying on and off for the last week or so to install Loomio using the docker method, I've put in quite a few hours, and I am finding it frustrating.

I'm an experienced developer and web server admin but I have never used Docker before. When things go wrong I usually know how to start debugging them, but with Docker there is a whole layer in between which I don't understand, and I find it quite hard to accept that I will have to learn about it just to install Loomio. I know it's a useful thing to learn, but I was hoping to get Loomio up and running quickly so as to start using it! A whole array of docker containers linked together is no mean feat to understand.

I get the impression that @robertguthrie is the only person who knows the loomio docker system inside out and is therefore swamped with requests for help, but that you are a busy chap, like the rest of us, and cannot be expected to be there at the beck and call of anyone who attempts installation.

If there was a way of installing it that did not require this extra layer, perhaps people would be able to help each other more, and get help from Stack Overflow and the like.

It's also difficult to make configuration changes - I tried to run it on a different port, but failed. Which means I have to use a whole VPS for this, rather than running it on the same server as another bunch of websites. In fact being forced to use nginx makes this difficult anyway; I have a bunch of apache vhosts and was hoping this would just be another one.

Also, the docker container uses a lot of RAM, which is what drives up the cost of a VPS. So it is costing a lot to run this.

I'm sorry, I realise this probably comes across as a rant, but I think it is important for free software projects to be relatively easy to install, and not to rely on one beleagured person as the font of all knowledge ...

N

Naomi Fri 12 Apr 2019 12:43PM

P.S. I worked out how to run it on a different port - I turned off apache, which was competing for port 80 of course, and ran docker-compose up which caused the SSL certificate to be generated (for which it must be running on port 80). Then I went into docker-compose.yml and "80:80" to "81:80" and "443:443" to "444:443" , did "docker-compose down" and then "up -d" again and lo and behold I could access loomio on port 444 and (after restarting apache) could access my other sites on 443! Happy days. I'm having an issue with email now though, which I'll start a new thread for. I attempting to debug now with the help of a more knowledgeable person, and will post any info that might help others in that thread.

@robertguthrie if I get through this I would like to compile what I've learnt into a troubleshooting guide - would you be interested in that being added to your repo?

RG

Robert Guthrie Fri 12 Apr 2019 8:26PM

Hi @naomir , totally appreciate your post, thanks for writing it.

I'll just add my reasoning first, then address your questions.

I've chosen the Docker path because it gives you a secure, full featured loomio install in the least number of steps. That is: You get SSL/HTTPS, inbound email, simple DNS settings, background jobs and crontab, redis and postgresql, and even a simple backup system.

Our crowdfunding campaign in 2014? promised a "one-click" install process - which is actually kind of impossible, but this is the closest I've been able to come to providing a simple to setup processs for hosting your own Loomio install.

Personally I find that docker keeps the level of complexity down.

If you're trying to run this alongside other services, or in a custom way, then it will get much less straightforward - that's just how it is. If you don't use Docker, then you lose the ability to easily update your system if I change a requirement. (like when I added redis to the stack 4 months ago, or when we moved from FAYE to actioncable last year).

I try to spend only a small amount of my time on the devops side of Loomio, becuase I want to spend as much time as possible writing good features and UX.

I think that running your own instance is always going to be something that requires a high level of server/linux/database experience, if you want to do it really well.. I've done my best to make it easy to get started, and also keep loomio.org running so people don't have to do this at all.

That said, I really like it when people such as yourself come along and actually use this work I've done. Sometimes I wonder if anyone is using it - because most people don't communicate with me... and we very rarely get any contributions, which I understand - because it is hard to contribute to a complex project.

I'd be happy to add/contribute to documentation about running your own production server. Have you seen the guide on setting up your own development environment? That covers quite a lot of this. (and may also need updating)

KK

Klaus Kobald Wed 22 May 2019 7:01PM

The docker guide does not work for a new blank server, because the command docker exec -ti loomio-db su - postgres -c 'createdb loomio_production' fails with Error: No such container: loomio-db
This is obvious, because no container is running at that time. I tried with the docker-compose up, but it leads to a complete mess I think. At the end I only get "500 Server Error" with no useful log information.

RG

Robert Guthrie Wed 22 May 2019 7:14PM

Ok, I'll run through a setup from blank again and update the guide. If I may ask, where do you plan to use Loomio?

BB

Brendan Butler Wed 22 May 2019 7:20PM

I am in the same situation. I appreciate you taking the time out of your day to do this :) Personally, I plan to use Loomio for a project I am helping organize development for named Music Stash.

KK

Klaus Kobald Wed 22 May 2019 7:24PM

We would like to use it for the austrian burningman community. :heart:

RG

Robert Guthrie Wed 22 May 2019 7:57PM

Ok @klauskobald and @brendanbutler please try this:

docker-compose up -d db
docker exec -ti loomio-db su - postgres -c 'createdb loomio_production'
docker-compose run app rake db:setup

BB

Brendan Butler Wed 22 May 2019 8:32PM

@robertguthrie
I've tested with these new commands in replace of database integration; it worked flawlessly up until the docker-compose up -d after the Cron tab is edited. No errors bringing it up, until the very last container (let's encrypt):

And I get 502 bad gateway errors when browsing to the domain

RG

Robert Guthrie Wed 22 May 2019 8:34PM

It can take upto 5 minutes for the app to boot. You will see bad gateway until then. I'll add that to the readme. You can see it boot with the logs command.

BB

Brendan Butler Wed 22 May 2019 8:35PM

Alright thanks so much, I'll update you in a few minutes then :)Do I need to worry about that letsencrypt error?

Load More