diff --git a/CHANGELOG.md b/CHANGELOG.md index c291a65..a01b594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # nystudio107/craft Change Log +## 2.5.2 - 2022.03.26 +### Added +* Added more logging to indicate when a container is waiting for another service to start up, and when seeding a database is complete +* Run `composer craft-update` after a `composer install` is done via `composer_install.sh` + +### Changed +* Moved permissions setting to Docker image creation + ## 2.5.1 - 2022.03.26 ### Added * Dramatically sped up the startup time for the PHP containers by moving the permissions setting script to run asynchronously in the queue container via the `run_queue.sh` script diff --git a/docker-config/php-prod-craft/composer_install.sh b/docker-config/php-prod-craft/composer_install.sh index 1730544..01339cf 100755 --- a/docker-config/php-prod-craft/composer_install.sh +++ b/docker-config/php-prod-craft/composer_install.sh @@ -12,5 +12,13 @@ cd /var/www/project/cms if [ ! -f "composer.lock" ] || [ ! -d "vendor" ]; then - su-exec www-data composer install --verbose --no-progress --optimize-autoloader --no-interaction + su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction + # Wait until the MySQL db container responds + echo "### Waiting for MySQL database" + until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" + do + sleep 1 + done + # Run any pending migrations/project config changes + su-exec www-data composer craft-update fi diff --git a/docker-config/php-prod-craft/run_queue.sh b/docker-config/php-prod-craft/run_queue.sh index df7937a..f95b263 100755 --- a/docker-config/php-prod-craft/run_queue.sh +++ b/docker-config/php-prod-craft/run_queue.sh @@ -13,14 +13,14 @@ # @license MIT cd /var/www/project/cms -# Force the permissions to be set properly -chown -R www-data:www-data /var/www/project & # Wait until the MySQL db container responds +echo "### Waiting for MySQL database" until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" do sleep 1 done # Wait until the `composer install` is done by looking for the `vendor/autoload.php` file +echo "### Waiting for vendor/autoload.php" while [ ! -f vendor/autoload.php ] do sleep 1