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