akkoma/docker-entrypoint.sh

19 lines
392 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' ] && [ "$2" = 'start' ]; then
echo "-- Running migrations..."
pleroma_ctl migrate
echo "-- Starting!"
fi
exec "$@"