Files
MineSeeker/docker/entrypoint.sh
T

24 lines
727 B
Bash

#!/bin/sh
set -e
echo "[entrypoint] Waiting for database..."
until php -r "new PDO('pgsql:host=db;port=5432;dbname=${POSTGRES_DB}', '${POSTGRES_USER}', '${POSTGRES_PASSWORD}');" 2>/dev/null; do
echo "[entrypoint] Database not ready, retrying in 2s..."
sleep 2
done
echo "[entrypoint] Database is ready."
if [ "$#" -gt 0 ]; then
echo "[entrypoint] Starting worker command: $*"
exec "$@"
fi
echo "[entrypoint] Clearing and warming Symfony cache..."
php bin/console cache:clear
echo "[entrypoint] Running database migrations..."
php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
echo "[entrypoint] Starting FrankenPHP..."
exec frankenphp run --config /etc/caddy/Caddyfile "$@"