2020-10-30 14:16:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-11-14 18:31:23 +00:00
|
|
|
echo "-- Waiting for database..."
|
2023-09-05 17:46:47 +00:00
|
|
|
while ! pg_isready -U ${MOBILIZON_DATABASE_USERNAME} -d postgres://${MOBILIZON_DATABASE_HOST}:${MOBILIZON_DATABASE_PORT:-5432}/${MOBILIZON_DATABASE_DBNAME} -t 1; do
|
2020-11-14 18:31:23 +00:00
|
|
|
sleep 1s
|
|
|
|
done
|
|
|
|
|
2023-09-07 07:03:53 +00:00
|
|
|
PGPASSWORD=$MOBILIZON_DATABASE_PASSWORD psql -U $MOBILIZON_DATABASE_USERNAME -d $MOBILIZON_DATABASE_DBNAME -h $MOBILIZON_DATABASE_HOST -p ${MOBILIZON_DATABASE_PORT:-5432} -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 -p ${MOBILIZON_DATABASE_PORT:-5432} -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'
|
2020-11-14 18:31:23 +00:00
|
|
|
|
2020-10-30 14:16:33 +00:00
|
|
|
echo "-- Running migrations..."
|
|
|
|
/bin/mobilizon_ctl migrate
|
|
|
|
|
|
|
|
echo "-- Starting!"
|
|
|
|
exec /bin/mobilizon start
|