feat: Create a Docker Image around the laravel app

This commit is contained in:
u00lipp
2025-10-21 18:37:25 +02:00
parent 0bbb4571bd
commit f978844e68
7 changed files with 287 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/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