indy-wp/entrypoint.sh

34 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/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 themeinstaller (entrypoint-theme.sh will be called later)
# -------------------------------------------------
exec /usr/local/bin/docker-entrypoint.sh "$@"