2026-03-04 22:49:01 +00:00
|
|
|
|
#!/bin/bash
|
2026-03-05 07:11:01 +00:00
|
|
|
|
set -eu
|
2026-03-04 22:49:01 +00:00
|
|
|
|
|
2026-03-05 07:11:01 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-09 19:56:56 +00:00
|
|
|
|
# 0️⃣ Run the official WordPress entrypoint first
|
2026-03-05 07:11:01 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
docker-entrypoint.sh "$@"
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-09 19:56:56 +00:00
|
|
|
|
# 1️⃣ Verify core exists (optional safety net)
|
2026-03-05 07:11:01 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
if [ ! -d /var/www/html/wp-admin ]; then
|
|
|
|
|
|
echo "❌ WordPress core missing after docker-entrypoint.sh"
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-09 19:56:56 +00:00
|
|
|
|
# 2️⃣ wp-config.php (already created by the official entrypoint)
|
2026-03-05 07:11:01 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-09 19:56:56 +00:00
|
|
|
|
# No need to create it here – the official entrypoint does it.
|
2026-03-05 07:11:01 +00:00
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-09 19:56:56 +00:00
|
|
|
|
# 3️⃣ Wait for DB to be ready (optional, the official entrypoint also does this)
|
2026-03-05 07:11:01 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
until wp db check --path=/var/www/html --allow-root > /dev/null 2>&1; do
|
|
|
|
|
|
echo "⏳ Waiting for database..."
|
|
|
|
|
|
sleep 2
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-09 19:56:56 +00:00
|
|
|
|
# 4️⃣ Hand over to the theme‑installer (entrypoint-theme.sh will be called later)
|
2026-03-05 07:11:01 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
exec /usr/local/bin/docker-entrypoint.sh "$@"
|