fix: buat direktori storage pada deploy pertama sebelum view:cache
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user