adrema/.docker/php-entrypoint

31 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-07-20 22:58:51 +02:00
#!/bin/bash
set -e
# --------------------------- ensure appkey is set ----------------------------
if [ $APP_KEY = "YOUR_APP_KEY" ]; then
echo "----------------------- Keinen APP KEY gefunden. Key wird generiert: $(php artisan key:generate --show) ----------------------- Füge diesen Key als APP_KEY ein ---------------------"
exit 1
fi
# ------------------------- check for database access -------------------------
function wait_for_db {
while true; do
echo "waiting for Database init"
php -r 'new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'");' > /dev/null && return 0
sleep 1
done
}
wait_for_db
php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force
php artisan migrate --force
2023-07-21 11:28:45 +02:00
mkdir /app/packages/laravel-nami/.cookies || true
mkdir /app/storage/app || true
chown -R www-data:www-data /app/packages/laravel-nami/.cookies
chown -R www-data:www-data /app/storage/app
2023-07-20 22:58:51 +02:00
php-fpm -F -R -O