feat(deploy): configure deployment for ClinicPro on Liara PHP platform
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
# Liara PHP platform pre-start hook — runs before the app starts, with env vars
|
||||
# available. One-time init: wait for DB, generate JWT keypair, warm cache, migrate.
|
||||
set -e
|
||||
|
||||
echo "pre-start: waiting for database..."
|
||||
i=0
|
||||
until php bin/console doctrine:query:sql "SELECT 1" >/dev/null 2>&1; do
|
||||
i=$((i + 1))
|
||||
if [ "$i" -ge 30 ]; then
|
||||
echo "Database not reachable after 60s — aborting." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "waiting for database... ($i)"
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# JWT keypair persists on the mounted 'jwt' disk; --skip-if-exists is idempotent.
|
||||
php bin/console lexik:jwt:generate-keypair --skip-if-exists --no-interaction
|
||||
|
||||
php bin/console cache:clear --no-warmup
|
||||
php bin/console cache:warmup
|
||||
|
||||
# Apply pending migrations inside a transaction.
|
||||
php bin/console doctrine:migrations:migrate --all-or-nothing --no-interaction
|
||||
Reference in New Issue
Block a user