1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-30 20:06:07 +00:00
mobilizon/docker/production/docker-entrypoint.sh

17 lines
675 B
Bash
Raw Normal View History

#!/bin/sh
set -e
echo "-- Waiting for database..."
while ! pg_isready -U ${MOBILIZON_DATABASE_USERNAME} -d postgres://${MOBILIZON_DATABASE_HOST}:5432/${MOBILIZON_DATABASE_DBNAME} -t 1; do
sleep 1s
done
PGPASSWORD=$MOBILIZON_DATABASE_PASSWORD psql -U $MOBILIZON_DATABASE_USERNAME -d $MOBILIZON_DATABASE_DBNAME -h $MOBILIZON_DATABASE_HOST -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
PGPASSWORD=$MOBILIZON_DATABASE_PASSWORD psql -U $MOBILIZON_DATABASE_USERNAME -d $MOBILIZON_DATABASE_DBNAME -h $MOBILIZON_DATABASE_HOST -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'
echo "-- Running migrations..."
/bin/mobilizon_ctl migrate
echo "-- Starting!"
exec /bin/mobilizon start