akkoma/docker-entrypoint.sh

19 lines
392 B
Bash
Raw Normal View History

2023-07-29 15:45:03 +00:00
#!/bin/sh
set -e
2023-07-29 15:45:03 +00:00
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
2023-07-29 15:45:03 +00:00
done
fi
if [ "$1" = 'pleroma' ] && [ "$2" = 'start' ]; then
2023-07-29 15:45:03 +00:00
echo "-- Running migrations..."
pleroma_ctl migrate
2023-07-29 15:45:03 +00:00
echo "-- Starting!"
fi
2023-07-29 15:45:03 +00:00
exec "$@"