Update .env.example for local and production database configurations, ensuring clarity on usage. Modify .gitattributes to enforce LF line endings for shell scripts. Enhance README.md with Docker and Coolify setup instructions for production deployment.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
cd /var/www/html
|
||||
|
||||
echo "[flixcooks] Waiting for database..."
|
||||
TRIES=0
|
||||
MAX_TRIES="${DB_WAIT_MAX_TRIES:-30}"
|
||||
|
||||
until php scripts/db-check.php >/dev/null 2>&1; do
|
||||
TRIES=$((TRIES + 1))
|
||||
if [ "$TRIES" -ge "$MAX_TRIES" ]; then
|
||||
echo "[flixcooks] Database not reachable after ${MAX_TRIES} attempts." >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[flixcooks] Applying schema..."
|
||||
php -r "require 'helpers.php'; require_database(); echo \"schema ok\n\";"
|
||||
|
||||
if [ "${RUN_DB_SEED:-false}" = "true" ]; then
|
||||
echo "[flixcooks] Seeding recipes from data/recipes.json..."
|
||||
php scripts/db-seed.php
|
||||
fi
|
||||
|
||||
echo "[flixcooks] Starting Apache..."
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user