add two more
This commit is contained in:
parent
8651cf0895
commit
d56eea86ed
|
|
@ -3,7 +3,6 @@ set -e
|
||||||
|
|
||||||
echo "[+] Starting Laravel Initialization Script..."
|
echo "[+] Starting Laravel Initialization Script..."
|
||||||
|
|
||||||
# ۱. ساخت پوشههای حیاتی لاراول که احتمال دارد به خاطر مونت شدن حذف شده باشند
|
|
||||||
echo "[+] Ensuring Laravel storage and cache directories exist..."
|
echo "[+] Ensuring Laravel storage and cache directories exist..."
|
||||||
mkdir -p storage/framework/cache/data \
|
mkdir -p storage/framework/cache/data \
|
||||||
storage/framework/views \
|
storage/framework/views \
|
||||||
|
|
@ -11,29 +10,24 @@ mkdir -p storage/framework/cache/data \
|
||||||
storage/logs \
|
storage/logs \
|
||||||
bootstrap/cache[cite: 4, 5]
|
bootstrap/cache[cite: 4, 5]
|
||||||
|
|
||||||
# ۲. مدیریت فایل تنظیمات محیطی
|
|
||||||
if [ ! -f .env ]; then
|
if [ ! -f .env ]; then
|
||||||
echo "[+] .env file not found, creating from .env.example..."
|
echo "[+] .env file not found, creating from .env.example..."
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ۳. تولید کلید اختصاصی اپلیکیشن در صورت عدم وجود
|
|
||||||
if ! grep -q "APP_KEY=base64:" .env; then
|
if ! grep -q "APP_KEY=base64:" .env; then
|
||||||
echo "[+] Generating application key..."
|
echo "[+] Generating application key..."
|
||||||
php artisan key:generate --force
|
php artisan key:generate --force
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ۴. پاکسازی کشهای قدیمی فریمورک برای جلوگیری از خطای Valid cache path
|
|
||||||
echo "[+] Clearing stale Laravel configurations and views..."
|
echo "[+] Clearing stale Laravel configurations and views..."
|
||||||
php artisan config:clear || true
|
php artisan config:clear || true
|
||||||
php artisan view:clear || true
|
php artisan view:clear || true
|
||||||
php artisan cache:clear || true[cite: 7]
|
php artisan cache:clear || true[cite: 7]
|
||||||
|
|
||||||
# ۵. تنظیم دسترسی کامل خواندن و نوشتن برای سازگاری کامل داکر و سیستم میزبان
|
|
||||||
echo "[+] Setting permissions for storage and bootstrap/cache..."
|
echo "[+] Setting permissions for storage and bootstrap/cache..."
|
||||||
chmod -R 777 storage bootstrap/cache[cite: 5]
|
chmod -R 777 storage bootstrap/cache[cite: 5]
|
||||||
|
|
||||||
echo "[+] Laravel is ready! Launching application..."
|
echo "[+] Laravel is ready! Launching application..."
|
||||||
|
|
||||||
# استفاده از "$@" به جای هاردکد کردن php-fpm باعث میشود کانتینر دستورات CMD را به درستی بپذیرد
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user