From e65fd771561e28a99c8b646f7e8db368c5b27496 Mon Sep 17 00:00:00 2001 From: Saufi Date: Tue, 19 May 2026 15:36:28 +0800 Subject: [PATCH] fix: buat direktori storage pada deploy pertama sebelum view:cache --- docker/entrypoint.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 8aa9f2c..8286e62 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -76,13 +76,20 @@ php artisan storage:link 2>/dev/null || true # ── 6. Cache (production sahaja) ────────────────────────────────────────────── if [ "${APP_ENV}" = "production" ]; then + # Pastikan direktori storage wujud (penting bila named volume kosong pada deploy pertama) + mkdir -p /var/www/storage/framework/views \ + /var/www/storage/framework/cache/data \ + /var/www/storage/framework/sessions \ + /var/www/storage/logs \ + /var/www/storage/app/public + chown -R www-data:www-data /var/www/storage + chmod -R 775 /var/www/storage + echo "⚡ Caching config, routes, views..." php artisan config:cache php artisan route:cache php artisan view:cache php artisan event:cache - # Opcache: matikan validate_timestamps untuk prestasi - # (sudah dikonfigur dalam php.ini prod) fi echo ""