More work on init-php
This commit is contained in:
parent
0aa55fd6b8
commit
ebabe6e698
11
init-php.sh
11
init-php.sh
@ -1,16 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Run our web init startup
|
# Run our web init startup
|
||||||
|
rm -f bootstrap/cache/*.php
|
||||||
/sbin/init php-fpm &
|
/sbin/init php-fpm &
|
||||||
|
|
||||||
# Wait for DB to start
|
# Wait for DB to start
|
||||||
# If DB_HOST not set, source the env file
|
# If DB_HOST not set, source the env file
|
||||||
[ -z "${DB_HOST}" -a -r .env ] && . .env
|
[ -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}"
|
echo "? Waiting for database at ${DB_HOST}:${DB_PORT}"
|
||||||
sleep 1;
|
|
||||||
done
|
done
|
||||||
echo "- DB is active on ${DB_HOST}:${DB_PORT}"
|
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
|
exec ./artisan server:start
|
||||||
|
Loading…
Reference in New Issue
Block a user