diff --git a/containers/php/entrypoint.sh b/containers/php/entrypoint.sh index 2138bf3..fa5835d 100644 --- a/containers/php/entrypoint.sh +++ b/containers/php/entrypoint.sh @@ -6,12 +6,10 @@ if [ -f '.env' ]; then . .env fi -if [ "$APP_ENV" != "local" ]; then - php artisan optimize -fi - if [ "$1" = "php-fpm" ]; then - if [ "$APP_ENV" = "local" ]; then + if [ "$APP_ENV" != "local" ]; then + php artisan optimize + else composer install fi php artisan migrate --force @@ -20,9 +18,15 @@ if [ "$1" = "php-fpm" ]; then fi elif [ "$1" = "scheduler" ]; then wait-for "${PHP_HOST:?Missing PHP_HOST}:${PHP_PORT:?Missing PHP_PORT}" -t 60 + if [ "$APP_ENV" != "local" ]; then + php artisan optimize + fi set -- crond -f -d elif [ "$1" = "worker" ]; then wait-for "${PHP_HOST:?Missing PHP_HOST}:${PHP_PORT:?Missing PHP_PORT}" -t 60 + if [ "$APP_ENV" != "local" ]; then + php artisan optimize + fi set -- su -s /bin/sh -c "php artisan queue:work --tries=3 --timeout=1800" www-data fi