decidim: decidim.hacktivism.ch behind Caddy :9027

This commit is contained in:
Hernâni Marques 2026-08-17 15:31:10 +02:00
parent d519fb3c80
commit 609056615e
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
24 changed files with 840 additions and 24 deletions

22
configs/decidim/entrypoint.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# Wait for Postgres, migrate, then exec CMD (rails or sidekiq).
set -euo pipefail
export RAILS_ENV="${RAILS_ENV:-production}"
echo "koopa-decidim: waiting for postgres..."
i=0
until bundle exec rails runner 'ActiveRecord::Base.connection.execute("SELECT 1")' >/dev/null 2>&1; do
i=$((i + 1))
if [ "$i" -ge 60 ]; then
echo "koopa-decidim: postgres not ready after ${i} tries" >&2
exit 1
fi
sleep 3
done
echo "koopa-decidim: db:prepare"
bundle exec rails db:prepare
echo "koopa-decidim: exec $*"
exec "$@"