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:
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):
Additional context
N/A
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.
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