Files
kazewp/templates/wp-setup.sh.template
T

30 lines
740 B
Bash

#!/bin/bash
wpcli() {
docker compose run --rm wpcli "$@"
}
echo "Waiting for MariaDB to be ready..."
while [ "$(docker inspect --format='{{.State.Health.Status}}' db_${DOMAIN})" != "healthy" ]; do
echo "MariaDB is not healthy yet. Retrying..."
sleep 5
done
echo "Installing WordPress..."
wpcli core install \
--url="https://${DOMAIN}" \
--title="${SITE_TITLE}" \
--admin_user="${ADMIN_USER}" \
--admin_password="${ADMIN_PASSWORD}" \
--admin_email="${ADMIN_EMAIL}" \
--skip-email
echo "Installing and activating plugins..."
wpcli plugin install wordfence --activate
wpcli theme install twentytwentyfour --activate
wpcli plugin update --all
wpcli theme update --all
echo "WordPress setup completed!"