From 60bce51aea6afe9a14e82f7c0525d4695a9efd9a Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 26 Mar 2022 23:07:18 -0400 Subject: [PATCH 1/3] feat: Run `composer craft-update` after a `composer install` is done via `composer_install.sh` --- docker-config/php-prod-craft/composer_install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 From 9a633e16f8909b4cdfc3c092f068210d4ffb9e65 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 26 Mar 2022 23:07:41 -0400 Subject: [PATCH 2/3] feat: Added more logging to indicate when a container is waiting for another service to start up, and when seeding a database is complete --- docker-config/php-prod-craft/run_queue.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 4acb74b44615bfacc264f4cf9e00b69a7f30c468 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 26 Mar 2022 23:07:51 -0400 Subject: [PATCH 3/3] chore: Version 2.5.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) 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