Hi there,
I had some issues while deploying a new install of loomio-deploy and following the install guide.
I'd be glad to make pull requests if needed but don't know docker too much, and I prefer ensuring my contribution would be useful before doing anything.
There were 2 points that were blocking and some things not completely clear in the process of the deploy.
Note that I now have a running instance after all, with only something like 4 hours between the start of the tutorial and the instance availability, which seems acceptable for a first deploy with tools I don't know. The guide is quite neat !
For the context, I :
- Used
sudo
instead of the root
account to setup the deploy : I never allow login with a root account on my servers, but it did not seem to be blocking for the installation process
- Added all configurations to the
env
file (smtp, oauth credentials etc.) upfront, before upping the containers for the first time, and just after having generated the env
and faye_env
files with the provided script
Blocking points
Assets compilation
First, the assets precompiled by the worker
container didn't seem to be shared with the loomio
container. I had to create an assets
folder in the lumio-deploy
folder, and add it to the volumes
of both container in the docker-compose.yml
file like the following :
loomio:
...
volumes:
- ./uploads:/loomio/public/system
- ./files:/loomio/public/files
- ./assets:/loomio/public/assets
worker:
...
volumes:
- ./uploads:/loomio/public/system
- ./files:/loomio/public/files
- ./assets:/loomio/public/assets
this allowed the precompiled assets from one container to be used by the loomio
one.
Note that I had to docker-compose restart
the loomio
container after the assets compilation so the Rails view's #asset_path
helper used the hash based version of the asset.
Nginx Upstream
I also had an issue and saw in the logs errors that were saying
nginx_1 | nginx.1 | 2017/10/19 10:13:00 [error] 64#64: *74 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: XXX.XXX.XX.XX, server: loomio.respublica-conseil.fr, request: "GET /client/1.8.222/app.js HTTP/2.0", upstream: "http://172.17.0.6:25/client/1.8.222/app.js", host: "loomio.respublica-conseil.fr", referrer: "https://loomio.respublica-conseil.fr/dashboard"
It took me some time to understand that Nginx was trying to route some of my HTTP requests to the docker-mailin
container that opens its port 25.
To fix that, I opened the nginx
container and edited the generated config file by removing the mailin
and worker
containers from the list of available in the loomio upstream :
upstream loomio.<my_domain.tld> {
## Can be connect with "bridge" network
# loomiodeploy_mailin_1
#server 172.17.0.6:25;
## Can be connect with "bridge" network
# loomiodeploy_loomio_1
server 172.17.0.5:3000;
## Can be connect with "bridge" network
# loomiodeploy_worker_1
#server 172.17.0.4:3000;
}
Note that we have two servers that are not needed here, that I had to manually comment out.
If I understand well how it works, the file is generated when the container is booted (docker-compose up
) and iterates over every available container, finds the one that publicly open ports and maps those ports to the loomio upstream here.
But I don't understand the templating language used, and don't know how to fix it in the template so it is not generated at boot time.
Wrap up
I'd appreciate if you could help me understand if I did something wrong or if these are actual bugs, and would be glad to help fixing them.
Thanks for all your work !!