feat: add entrypoint

This commit is contained in:
u00lipp
2025-10-23 08:10:45 +02:00
parent 28ed738e33
commit 8492f2cc33
6 changed files with 131 additions and 85 deletions
-25
View File
@@ -1,25 +0,0 @@
#!/bin/sh
set -eu
cd /var/www/html || exit 1
# Ensure Laravel dirs exist (idempotent)
mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache
# Fix perms (in case volumes are mounted)
chown -R nginx:nginx storage bootstrap/cache || true
chmod -R ug+rwX storage bootstrap/cache || true
# If Laravel present: clear stale build-stage caches pointing to /app, then warm new caches
if [ -f artisan ]; then
php artisan config:clear --no-ansi || true
php artisan cache:clear --no-ansi || true
php artisan route:clear --no-ansi || true
php artisan view:clear --no-ansi || true
# Optional: warm fresh caches in runtime path
php artisan config:cache --no-ansi || true
php artisan route:cache --no-ansi || true
php artisan view:cache --no-ansi || true
fi
exit 0