Skip to content

Commit

Permalink
Merge branch 'release/2.4.42' into craft-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Jun 22, 2021
2 parents 1d3314d + 51bf224 commit 27ff6d9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# nystudio107/craft Change Log

## 2.4.42 - 2021.06.22
### Changed
* Continue running the `php-fpm` containers as root (since `php-fpm` uses worker pools with the proper user/group), but switch to `su-exec` to ensure any craft CLI commands are run as `www-data`

## 2.4.41 - 2021.06.15
### Fixed
* Fixed typo in Dockerfile that would cause the PHP container to not build
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ services:
expose:
- "9000"
init: true
user: www-data
volumes:
*php-volumes
# queue - runs queue jobs via php craft queue/listen
Expand All @@ -59,10 +58,7 @@ services:
- "php"
env_file:
*env
expose:
- "9001"
init: true
user: www-data
volumes:
*php-volumes
# mariadb - database
Expand Down
6 changes: 6 additions & 0 deletions docker-config/php-dev-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN set -eux; \
&& \
# Packages to install
apk add --no-cache \
su-exec \
gifsicle \
jpegoptim \
libwebp-tools \
Expand Down Expand Up @@ -52,3 +53,8 @@ RUN mkdir -p /var/www/project/cms/storage \
chown -R www-data:www-data /var/www/project

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
7 changes: 4 additions & 3 deletions docker-config/php-prod-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN set -eux; \
&& \
# Packages to install
apk add --no-cache \
su-exec \
gifsicle \
jpegoptim \
libwebp-tools \
Expand Down Expand Up @@ -65,10 +66,10 @@ WORKDIR /var/www/project/cms
# 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 composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction \
CMD chown -R www-data:www-data /var/www/project \
&& \
chown -R www-data:www-data /var/www/project \
su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction \
&& \
composer craft-update \
su-exec www-data composer craft-update \
&& \
php-fpm
8 changes: 4 additions & 4 deletions docker-config/php-prod-craft/run_queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# 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 30 second sleep) should it exit unexpectedly for any reason
# (after a 60 second sleep) should it exit unexpectedly for any reason
#
# @author nystudio107
# @copyright Copyright (c) 2020 nystudio107
Expand All @@ -14,7 +14,7 @@
while true
do
cd /var/www/project/cms
php craft queue/listen 10
echo "-> craft queue/listen will retry in 30 seconds"
sleep 30
su-exec www-data php craft queue/listen 10
echo "-> craft queue/listen will retry in 60 seconds"
sleep 60
done

0 comments on commit 27ff6d9

Please sign in to comment.