From 2e0860713da9b45c5df9b709be018ea6069d3e75 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 7 May 2018 13:58:55 +1000 Subject: [PATCH] Only run caching for the app --- start | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/start b/start index 86bae8e..7596dec 100755 --- a/start +++ b/start @@ -11,22 +11,27 @@ if [ -x /usr/sbin/sshd -a "${SSH_START}" = "TRUE" ]; then fi # Laravel Specific -if [ "${env}" != "local" -a -r "artisan" ]; then - echo "Caching configuration..." - (php artisan config:cache && php artisan route:cache && php artisan view:cache) -fi - if [ "${role}" = "app" ]; then + if [ "${env}" != "local" -a -r "artisan" ]; then + echo "Caching configuration..." + (php artisan config:cache && php artisan route:cache && php artisan view:cache) + fi exec /usr/local/bin/docker-php-entrypoint "$@" elif [ "$role" = "queue" ]; then echo "Running the queue..." + # We'll delay starting in case the app is caching + sleep 15 php ${PHP_OPTIONS} artisan queue:work --verbose --tries=${WORK_TRIES:-1} --timeout=${WORK_TIMEOUT:-90} ${WORK_QUEUES:+--queue=${WORK_QUEUES}} ${WORK_MEMORY:+--memory=${WORK_MEMORY}} elif [ "$role" = "scheduler" ]; then + echo "Running the scheduler..." + # We'll delay starting in case the app is caching + sleep 15 + while [ true ]; do php ${PHP_OPTIONS} artisan schedule:run --verbose --no-interaction & sleep 60