Skip to content

Commit

Permalink
fix: waiting for app to setup completely
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed May 8, 2024
1 parent 172f87d commit d18f7f4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions containers/php/entrypoint-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ if [ "$1" = "php-fpm" ]; then
composer install
php artisan migrate --force
elif [ "$1" = "scheduler" ]; then
wait-for "${PHP_HOST:?Missing PHP_HOST}:${PHP_PORT:?Missing PHP_PORT}" -t 60
set -- crond -f
elif [ "$1" = "worker" ]; then
wait-for "${PHP_HOST:?Missing PHP_HOST}:${PHP_PORT:?Missing PHP_PORT}" -t 60
set -- php artisan queue:work --tries=3 --timeout=1800
fi

Expand Down
2 changes: 2 additions & 0 deletions containers/php/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ if [ "$1" = "php-fpm" ]; then
php artisan migrate --force
elif [ "$1" = "scheduler" ]; then
# remove scheduler command, replace the $@
wait-for "${PHP_HOST:?Missing PHP_HOST}:${PHP_PORT:?Missing PHP_PORT}" -t 60
set -- crond -f
elif [ "$1" = "worker" ]; then
# remove worker command, replace the $@
wait-for "${PHP_HOST:?Missing PHP_HOST}:${PHP_PORT:?Missing PHP_PORT}" -t 60
set -- su -s /bin/sh -c "php artisan queue:work --tries=3 --timeout=1800" www-data
fi

Expand Down
2 changes: 2 additions & 0 deletions deploy/quadlet/scheduler.container
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Volume=/etc/localtime:/etc/localtime:ro
Volume=storage.volume:/var/www/html
Exec=scheduler
EnvironmentFile=%S/parceler.env
Environment=PHP_HOST=parceler-php
Environment=PHP_PORT=9000
2 changes: 2 additions & 0 deletions deploy/quadlet/worker.container
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Volume=/etc/localtime:/etc/localtime:ro
Volume=storage.volume:/var/www/html
Exec=worker
EnvironmentFile=%S/parceler.env
Environment=PHP_HOST=parceler-php
Environment=PHP_PORT=9000

0 comments on commit d18f7f4

Please sign in to comment.