decidim: mirror koopa-decidim setup (9027, docs for /sm showcase)
This commit is contained in:
parent
d519fb3c80
commit
9ae0dfa429
21 changed files with 998 additions and 2 deletions
22
configs/decidim/entrypoint.sh
Executable file
22
configs/decidim/entrypoint.sh
Executable 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 "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue