misc_pterodactyl-panel/.dev/docker/entrypoint.sh
Michael (Parker) Parker 1ac13c82fa more docker changes
2018-07-18 17:15:28 -04:00

24 lines
462 B
Bash

#!/bin/ash
cd /app
tini -- php-fpm
until nc -z -v -w30 $DB_HOST 3306
do
echo "Waiting for database connection..."
# wait for 5 seconds before check again
sleep 5
done
if [ "$(cat .env)" == "" ]; then
cat /app/.env.example > /app/.env
fi
if [ "$(cat .env | grep APP_KEY)" == "APP_KEY=" ]; then
echo "Generating New Key"
php artisan key:generate --force
fi
php artisan migrate --seed --force
echo "Done"
nginx -g 'pid /tmp/nginx.pid; daemon off;'