Skip to content

Commit

Permalink
Merge branch 'release/2.5.1' into devmode-vite
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Mar 18, 2022
2 parents 544f621 + b408e33 commit 0eaa28b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# nystudio107/craft Change Log

## 2.5.1 - 2022.03.17
### Added

* Run migrations / project config changes via the `run_queue.sh` script, only after the db container responds

## 2.5.0 - 2022.03.17
### Changed

### Added
* Significantly increased startup times via a `composer_install.sh` script that only runs `composer install` at container startup time if `composer.lock` or `vendor/` is missing
Expand Down
4 changes: 0 additions & 4 deletions docker-config/php-prod-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,4 @@ CMD chown -R www-data:www-data /var/www/project \
&& \
./composer_install.sh \
&& \
cd /var/www/project/cms \
&& \
su-exec www-data composer craft-update \
&& \
php-fpm
21 changes: 12 additions & 9 deletions docker-config/php-prod-craft/run_queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
# Run Queue shell script
#
# This shell script runs the Craft CMS queue via `php craft queue/listen`
# It's wrapped in a "keep alive" infinite loop that restarts the command
# (after a 60 second sleep) should it exit unexpectedly for any reason
# It waits until the database container responds, then runs any pending
# migrations / project config changes via the `craft-update` Composer script,
# then runs the queue listener that listens for and runs pending queue jobs
#
# @author nystudio107
# @copyright Copyright (c) 2020 nystudio107
# @copyright Copyright (c) 2022 nystudio107
# @link https://nystudio107.com/
# @license MIT

sleep 60
while true
# Wait until the db container responds
until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1"
do
cd /var/www/project/cms
su-exec www-data php craft queue/listen 10
echo "-> craft queue/listen will retry in 60 seconds"
sleep 60
sleep 1
done
# Run any pending migrations/project config changes
cd /var/www/project/cms
su-exec www-data composer craft-update
# Run a queue listener
su-exec www-data php craft queue/listen 10

0 comments on commit 0eaa28b

Please sign in to comment.