@@ -18,22 +18,9 @@ trap shutdown SIGTERM SIGINT
1818# Remove any existing ready marker
1919rm -f /var/www/html/storage/laravel_ready
2020
21- # Universal permission fix for all systems
21+ # Fix permissions at startup
2222echo " [MAIN] SETUP: Fixing Laravel directory permissions..."
23- # Ensure www-data user owns all files (www-data is standard across systems)
24- chown -R www-data:www-data /var/www/html 2> /dev/null || true
25- # Set proper permissions for storage and cache directories
26- chmod -R 775 /var/www/html/storage 2> /dev/null || true
27- chmod -R 775 /var/www/html/bootstrap/cache 2> /dev/null || true
28- # Ensure specific subdirectories have correct permissions
29- chmod -R 775 /var/www/html/storage/framework/cache 2> /dev/null || true
30- chmod -R 775 /var/www/html/storage/framework/sessions 2> /dev/null || true
31- chmod -R 775 /var/www/html/storage/framework/testing 2> /dev/null || true
32- chmod -R 775 /var/www/html/storage/framework/views 2> /dev/null || true
33- chmod -R 775 /var/www/html/storage/logs 2> /dev/null || true
34- chmod -R 775 /var/www/html/storage/app 2> /dev/null || true
35- # Make artisan executable
36- chmod +x /var/www/html/artisan 2> /dev/null || true
23+ /usr/local/bin/fix-permissions.sh
3724
3825# Wait for database to be ready
3926echo " [MAIN] WAITING: Database connection..."
@@ -96,12 +83,9 @@ php artisan config:clear
9683php artisan config:cache
9784php artisan route:cache
9885
99- # Universal permission fix after optimization
86+ # Fix permissions after optimization
10087echo " [MAIN] SETUP: Fixing permissions after optimization..."
101- chown -R www-data:www-data /var/www/html/storage 2> /dev/null || true
102- chown -R www-data:www-data /var/www/html/bootstrap/cache 2> /dev/null || true
103- chmod -R 775 /var/www/html/storage 2> /dev/null || true
104- chmod -R 775 /var/www/html/bootstrap/cache 2> /dev/null || true
88+ /usr/local/bin/fix-permissions.sh
10589
10690# Create ready marker to signal that the app is fully set up
10791echo " [MAIN] SUCCESS: Application setup complete! Creating ready marker..."
0 commit comments