Skip to content

Commit

Permalink
Merge branch 'release/2.5.1' into craft-vite
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Mar 26, 2022
2 parents aa250f4 + dcf301d commit 22a185f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# nystudio107/craft Change Log

## 2.5.0 - 2022.03.19
## 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

## 2.5.0 - 2022.03.19
### Added
* Switch the main branch to `craft-vite` so the default project now uses Vite.js
* 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
6 changes: 2 additions & 4 deletions docker-config/php-dev-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,5 @@ RUN mkdir -p /var/www/project/cms/storage \

WORKDIR /var/www/project/cms

# Force permissions, update Craft, and start php-fpm
CMD chown -R www-data:www-data /var/www/project \
&& \
php-fpm
# Start php-fpm
CMD php-fpm
19 changes: 7 additions & 12 deletions docker-config/php-prod-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,12 @@ RUN chmod a+x run_queue.sh \
COPY ./composer_install.sh .
RUN chmod a+x composer_install.sh

# Force permissions, update Craft, and start php-fpm

# Do a `composer install` without running any Composer scripts
# - If `composer.lock` is present, it will install what is in the lock file
# - If `composer.lock` is missing, it will update to the latest dependencies
# and create the `composer.lock` file
# This automatic running adds to the startup overhead of `docker-compose up`
# but saves far more time in not having to deal with out of sync versions
# when working with teams or multiple environments
CMD chown -R www-data:www-data /var/www/project \
&& \
./composer_install.sh \
# Run the composer_install.sh script that will do a `composer install`:
# - If `composer.lock` is missing
# - If `vendor/` is missing
# ...then start up php-fpm. The `run_queue.sh` script in the queue container
# will take care of running any pending migrations and apply any Project Config changes,
# as well as set permissions via an async CLI process
CMD ./composer_install.sh \
&& \
php-fpm
2 changes: 2 additions & 0 deletions docker-config/php-prod-craft/run_queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# @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
until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1"
do
Expand Down

0 comments on commit 22a185f

Please sign in to comment.