Files
kazewp/templates/wp-setup.sh.template
T
2024-12-30 21:15:05 +09:00

32 lines
832 B
Bash

#!/bin/bash
wpcli() {
docker compose run --rm wpcli "$@"
}
echo "Waiting for MySQL to be ready..."
#while ! docker exec db_${DOMAIN} mysqladmin ping -h localhost --silent; do
# sleep 1
#done
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!"