File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 22
33set -e
44
5- wait_for_services () {
5+ wait_for_php_fpm () {
66 wait-for " ${PHP_HOST:? Missing PHP_HOST} :${PHP_PORT:? Missing PHP_PORT} " -t 60
77}
88
9+ wait_for_redis () {
10+ wait-for " ${REDIS_HOST:? Missing REDIS_HOST} :${REDIS_PORT:- 6379} " -t 60
11+ }
12+
913optimize () {
1014 if [ " $APP_ENV " != " local" ]; then
1115 php artisan optimize
@@ -21,17 +25,18 @@ if [ "$1" = "php-fpm" ]; then
2125 if [ " $( id -u) " = ' 0' ]; then
2226 chown -R www-data:www-data storage
2327 fi
28+ wait_for_redis
2429 exec " $@ "
2530elif [ " $1 " = " scheduler" ]; then
26- wait_for_services
31+ wait_for_php_fpm
2732 optimize
2833 exec su -s /bin/sh -c " php artisan schedule:work --quiet" www-data
2934elif [ " $1 " = " worker" ]; then
30- wait_for_services
35+ wait_for_php_fpm
3136 optimize
3237 exec su -s /bin/sh -c " php artisan queue:work --tries=3 --timeout=1800" www-data
3338elif [ " $1 " = " nightwatch" ]; then
34- wait_for_services
39+ wait_for_php_fpm
3540 optimize
3641 exec su -s /bin/sh -c " php artisan nightwatch:agent --listen-on 0.0.0.0:2407" www-data
3742else
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ x-app: &app
77 UID : ${UID:-1000}
88 GID : ${GID:-1000}
99 restart : unless-stopped
10+ depends_on :
11+ - redis
1012 extra_hosts :
1113 - " host.docker.internal:host-gateway"
1214 volumes :
You can’t perform that action at this time.
0 commit comments