Skip to content

Commit

Permalink
refactor: removed optimization from generic commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed Jul 22, 2024
1 parent c017acc commit 9d417b8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions containers/php/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 9d417b8

Please sign in to comment.