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