18 lines
370 B
Bash
Executable file
18 lines
370 B
Bash
Executable file
#!/bin/sh
|
|
set -e
|
|
|
|
if [ "$1" = 'pleroma' ] || [ "$1" = 'pleroma_ctl' ]; then
|
|
echo "-- Waiting for database..."
|
|
while ! pg_isready -U "${DB_USER:-pleroma}" -d postgres://"${DB_HOST:-db}:5432/${DB_NAME:-pleroma}" -t 1; do
|
|
sleep 1s
|
|
done
|
|
fi
|
|
|
|
if [ "$1" = 'pleroma' ]; then
|
|
echo "-- Running migrations..."
|
|
pleroma_ctl migrate
|
|
|
|
echo "-- Starting!"
|
|
fi
|
|
|
|
exec "$@"
|