From ebabe6e698584ef568db94bf4f401582c56c1e5c Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 24 Jun 2021 21:31:02 +1000 Subject: [PATCH] More work on init-php --- init-php.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/init-php.sh b/init-php.sh index c0a48c4..e48cdff 100755 --- a/init-php.sh +++ b/init-php.sh @@ -1,16 +1,23 @@ #!/bin/bash # Run our web init startup +rm -f bootstrap/cache/*.php /sbin/init php-fpm & # Wait for DB to start # If DB_HOST not set, source the env file [ -z "${DB_HOST}" -a -r .env ] && . .env -while ! wait-for-it -h ${DB_HOST} -p ${DB_PORT} -t 5 -q; do +while ! wait-for-it -h ${DB_HOST} -p ${DB_PORT} -t 15 -q; do echo "? Waiting for database at ${DB_HOST}:${DB_PORT}" - sleep 1; - done +done echo "- DB is active on ${DB_HOST}:${DB_PORT}" +# Wait for our config to have been rebuild +while [ ! -e bootstrap/cache/config.php -o -e .migrate ]; do + echo "? Waiting for configuration to be built by init" + sleep 15; +done +echo "* Ready to start server" + exec ./artisan server:start