chg: pkg: make compatible the whole project with bare metal AND with docker #4
This commit is contained in:
18
docker/entrypoint.sh
Normal file
18
docker/entrypoint.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/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."
|
||||
|
||||
echo "[entrypoint] Warming up Symfony cache..."
|
||||
php bin/console cache:warmup
|
||||
|
||||
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 "$@"
|
||||
Reference in New Issue
Block a user