Decidim: Broken docker-compose

Created on 8 Oct 2019  路  4Comments  路  Source: decidim/decidim

Describe the bug
Our installation with docker-compose is broken.
I think there's a mix up between the images that we've published on Docker Hub:

  • By default we're telling Docker and docker-compose that we use the image decidim/decidim
  • This image only deals with generating the Decidim application, NOT for starting the containers of the application: there are multiple dependencies missing

After various months making tests and learning Docker, I've come to the conclusion that we should have a self contained Dockerfile, as this allows to easily work with Decidim singularities: new gems on the installation (on Gemfile or on subdirectories), monkeypatches or overrides on the code, etc.
As a solution for these problems there's the ONBUILD instruction but I think it's tricky and there are cases where it's deprecated as it's difficult to work with.

As an example of how I propose the final result for these changes, I've worked on a POC on Decidim Demo.

To Reproduce

APP_NAME=HelloWorld
docker run -it -v "$(pwd):/code" decidim/decidim ${APP_NAME}
sudo chown -R $(whoami): ${APP_NAME}
cd ${APP_NAME}
docker-compose up

Expected behavior
I'd have expected to get the app working.

Stacktrace

...
app_1 | Copied migration 20191008082781_make_blogposts_authors_polymorphics.decidim_blogs.rb from decidim_blogs
app_1 | route if Rails.env.development?
app_1 | mount LetterOpenerWeb::Engine, at: "/letter_opener"
app_1 | end
app_1 |
app_1 | insert config/environments/development.rb
helloworld_app_1 exited with code 0

Extra data (please complete the following information):

  • Device: Development machine
  • Device OS: Linux Mint 19.2
  • Browser: N/A
  • Decidim Version: 0.18
  • Decidim installation: N/A

Additional context
N/A

bug

Most helpful comment

Totally true, I tried to use the provided image to create an instance of Decidim, it didn't work. I ended by creating a custom Dockerfile which works pretty well (but it's slower the first time).
Find relevant files here:

https://github.com/Platoniq/decidim-hacks/blob/master/docker-compose.yml
https://github.com/Platoniq/decidim-hacks/tree/master/docker

All 4 comments

I'd love to hear feedback regarding this issue :)

Totally true, I tried to use the provided image to create an instance of Decidim, it didn't work. I ended by creating a custom Dockerfile which works pretty well (but it's slower the first time).
Find relevant files here:

https://github.com/Platoniq/decidim-hacks/blob/master/docker-compose.yml
https://github.com/Platoniq/decidim-hacks/tree/master/docker

We also have an example docker-compose working with Docker Swarm, Docker Flow as a load balancer, postgres and postgres backup:

https://github.com/AjuntamentDeSabadell/decidim-sabadell/blob/master/docker-compose.yml

FYI: I've update the previous docker file to aadd support for LetsEncrypt SSL certificates.

Was this page helpful?
0 / 5 - 0 ratings