More composer file/dir ownership fixes, test for nodev, dont call event:cache

This commit is contained in:
Deon George 2020-01-15 17:43:25 +11:00
parent 1850eb68c0
commit fc50334ccf

12
init
View File

@ -23,7 +23,7 @@ if [ "${role}" = "app" -a -e artisan ]; then
find ${php} -type f -exec chmod 640 {} \; find ${php} -type f -exec chmod 640 {} \;
find ${php} -type d -exec chmod 750 {} \; find ${php} -type d -exec chmod 750 {} \;
chown -R lamp:www-data ${php} chown -R lamp:www-data ${php}
chown -R www-data:www-data ${php}/storage ${php}/bootstrap chown -R www-data:www-data ${php}/storage ${php}/bootstrap ${php}/composer.*
[ -e ${php}/vendor ] && chown -R www-data:www-data ${php}/vendor [ -e ${php}/vendor ] && chown -R www-data:www-data ${php}/vendor
if [ "${env}" != "local" -a -r "artisan" ]; then if [ "${env}" != "local" -a -r "artisan" ]; then
@ -32,7 +32,13 @@ if [ "${role}" = "app" -a -e artisan ]; then
rm -f ${php}/bootstrap/cache/*.php rm -f ${php}/bootstrap/cache/*.php
chown -R www-data:www-data ${composer} chown -R www-data:www-data ${composer}
[ ! -d ${php}/vendor ] && mkdir -m 750 ${php}/vendor && chown www-data:www-data ${php}/vendor [ ! -d ${php}/vendor ] && mkdir -m 750 ${php}/vendor && chown www-data:www-data ${php}/vendor
su www-data -s /bin/sh -c "composer install --optimize-autoloader --no-dev" && ( test -e .composer.refresh && rm -f .composer.refresh ) if [ "${env}" == "dev" ]; then
NODEV="--no-dev"
fi
chmod g+w ${php}
su www-data -s /bin/sh -c "composer install --optimize-autoloader ${NODEV}" && ( test -e .composer.refresh && rm -f .composer.refresh )
chmod g-w ${php}
fi fi
if [ -r .migrate ]; then if [ -r .migrate ]; then
@ -41,7 +47,7 @@ if [ "${role}" = "app" -a -e artisan ]; then
fi fi
echo "Caching configuration..." echo "Caching configuration..."
su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache && php artisan event:cache)" su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)"
fi fi
exec /usr/local/bin/docker-php-entrypoint "$@" exec /usr/local/bin/docker-php-entrypoint "$@"