Changed init-php to wait on DB before starting server
This commit is contained in:
parent
ff32ed1025
commit
0aa55fd6b8
12
init-php.sh
12
init-php.sh
@ -1,6 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
# Run our web init startup
|
# Run our web init startup
|
||||||
/sbin/init php-fpm &
|
/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
|
||||||
|
echo "? Waiting for database at ${DB_HOST}:${DB_PORT}"
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
echo "- DB is active on ${DB_HOST}:${DB_PORT}"
|
||||||
|
|
||||||
exec ./artisan server:start
|
exec ./artisan server:start
|
||||||
|
Loading…
Reference in New Issue
Block a user