2022-07-26 17:58:42 -07:00
|
|
|
#!/bin/bash
|
2019-08-02 19:28:48 -07:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-08-12 16:29:19 -07:00
|
|
|
DATABASE_URL=${DATABASE_URL:-"postgres://${DB_USER:-postgres}:${DB_PASS:-postgres}@${DB_HOST:-db}:5432/${DB_NAME:-postgres}"}
|
2022-08-04 20:37:37 -07:00
|
|
|
|
2019-08-02 19:28:48 -07:00
|
|
|
echo "-- Waiting for database..."
|
2022-08-12 16:29:19 -07:00
|
|
|
while ! pg_isready -d $DATABASE_URL -t 1; do
|
2019-08-02 19:28:48 -07:00
|
|
|
sleep 1s
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "-- Running migrations..."
|
|
|
|
$HOME/bin/pleroma_ctl migrate
|
|
|
|
|
|
|
|
echo "-- Starting!"
|
|
|
|
exec $HOME/bin/pleroma start
|