fix(docker): add vendor directory check before skipping composer install
Prevents false positives from stale hash files when vendor/autoload.php is missing. This fixes "Failed to open stream" errors after volume cleanup or fresh clone scenarios where the hash file exists but vendor directory doesn't.
This commit is contained in:
2
Makefile
2
Makefile
@@ -58,4 +58,4 @@ docs:
|
||||
|
||||
db:
|
||||
@echo "Recreate DB..."
|
||||
docker compose exec --user www php-fpm bash -c "php artisan migrate:fresh && php artisan db:seed"
|
||||
docker compose exec --user www php-fpm bash -c "php artisan migrate:fresh --seed"
|
||||
|
||||
@@ -11,7 +11,7 @@ fi
|
||||
|
||||
gosu www mkdir -p .hashes
|
||||
|
||||
if [ ! -f .hashes/.composer-hash ] || ! sha1sum -c .hashes/.composer-hash; then
|
||||
if [ ! -f "vendor/autoload.php" ] || [ ! -f .hashes/.composer-hash ] || ! sha1sum -c .hashes/.composer-hash; then
|
||||
echo ">> composer.json or composer.lock changed, installing dependencies..."
|
||||
gosu www composer install --optimize-autoloader --no-interaction
|
||||
gosu www sha1sum composer.json composer.lock > .hashes/.composer-hash
|
||||
|
||||
Reference in New Issue
Block a user