Fix: hardcoded nginx instance
Better support asset sharing between Nginx and Decidim containers
Fix: Don't break certbot-nginx by leaving a temporarily broken nginx config
Install Decidim on LXD or any other container.
In case of LXD the host distribution is irrelevant, in any other case you will need Alpine Linux.
config-dist.sh
to config.sh
or config.anything.sh
and
change whatever you need to change.src
directory.* **setup.sh
(as root in native mode). Reads config.sh
by
default, if you prefer to use other file provide it as parameter.* If you place an empty directory instead, it will populate the
directory with a fresh or existing copy of Decidim given that you've set
one on $GIT_CLONE_REPO
. Be aware that Decidim hardcodes database name
on config/database.yml
to ${DECIDIM_INSTANCE}
_${ENVIRONMENT}
.
** For LXD you will need to enable subuid and subgid mappings, active
for the owner of src/
. Here a quick snippet for activation:
printf "lxd:$(id -u):1\nroot:$(id -u):1\n" | sudo tee -a /etc/subuid
printf "lxd:$(id -g):1\nroot:$(id -g):1\n" | sudo tee -a /etc/subgid
# restart lxd daemon now
HOST_IP=<set>
NGINX_IP=<set>
nft add table nat
nft 'add chain nat postrouting { type nat hook postrouting priority 100 ; }'
nft 'add chain nat prerouting { type nat hook prerouting priority -100 ; }'
nft "add rule nat prerouting ip daddr $HOST_IP tcp dport 80 dnat $NGINX_IP:80"
nft "add rule nat prerouting ip daddr $HOST_IP tcp dport 443 dnat $NGINX_IP:443"
nft list ruleset | tee /etc/nftables.*
lxc exec <container_name> -- su - <container_name> -c ash
You can install some gems by uncommenting or adding Decidim gems
$EDITOR Gemfile
bundle install
# then depending on what you've uncommented
# bin/rails decidim_consultations:install:migrations
# bin/rails decidim_conferences:install:migrations
# bin/rails decidim_initiatives:install:migrations
# bin/rails decidim_templates:install:migrations
bundle exec rails db:migrate
bundle exec rails db:seed
Probably! I accept sane non-breaking contributions which deal with other operating systems.
It would work, but data would be missing after reboots given its
stateless nature. I'm willing to accept contributions of Docker Compose
setups or scripts that use Docker, given that these deal with persistent
storage and use setup.sh
or decidim.sh
.
GPLv3 only.