clrghouz/init-php.sh

17 lines
377 B
Bash
Executable File

#!/bin/bash
# Run our web init startup
/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