diff --git a/Dockerfile b/Dockerfile index a6dc6f01..6113603d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,8 +55,8 @@ RUN mv vendor /vendor_clean # Copy the rest of the application files (will ignore vendor because of .dockerignore) COPY --chown=www-data:www-data . . -# Restore the clean vendor directory -RUN rm -rf vendor && mv /vendor_clean vendor +# Restore the clean vendor directory and set proper permissions +RUN rm -rf vendor && mv /vendor_clean vendor && chown -R www-data:www-data vendor # Final build verification RUN if [ ! -f vendor/laravel/prompts/src/helpers.php ]; then \ diff --git a/entrypoint.sh b/entrypoint.sh index 8a6535ca..a38ec83a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -75,9 +75,9 @@ fi echo "Verifying APP_KEY after generation:" grep "APP_KEY" .env -# Force autoloader regeneration to ensure absolute path consistency -echo "Regenerating autoloader..." -composer dump-autoload +# Ensure vendor directory matches composer.lock exactly, syncing missing packages +echo "Verifying and synchronizing Composer dependencies..." +composer install --no-interaction --optimize-autoloader # Verify vendor integrity at PHP level echo "Checking vendor visibility and READABILITY for PHP..."