diff --git a/Dockerfile b/Dockerfile index 385a2475..441a6396 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,15 +42,26 @@ RUN find . -type d -name "vendor" -not -path "./vendor*" -exec rm -rf {} + 2>/de # Remove composer.lock to ensure fresh install RUN rm -f composer.lock -# Create all necessary directories -RUN mkdir -p storage/framework/{cache,sessions,views,testing} \ +# Create ALL storage directories BEFORE composer install +RUN mkdir -p storage/framework/cache \ + && mkdir -p storage/framework/sessions \ + && mkdir -p storage/framework/views \ + && mkdir -p storage/framework/testing \ && mkdir -p storage/logs \ && mkdir -p bootstrap/cache \ && mkdir -p storage/framework/cache/data \ && chmod -R 777 storage \ && chmod -R 777 bootstrap/cache -# Install PHP dependencies (full install, not just --no-scripts) +# Create a temporary config file to avoid cache path issues during composer +RUN if [ ! -f config/app.php ]; then \ + echo " []];" > config/app.php; \ + fi + +# Set environment variable for cache path +ENV VIEW_COMPILED_PATH=/var/www/html/storage/framework/views + +# Install PHP dependencies RUN composer install --no-interaction --no-progress --optimize-autoloader # Verify critical files exist