wordpress/setup
meskio 2734427bd9
Wait for db to be ready on the setup
Instead of doing a sleep hack, let's actually check that the database is there.
2022-12-19 17:18:00 +01:00

18 lines
440 B
Bash
Executable File

#!/bin/sh
export WORDPRESS_ROOT=/app
WP_CLI="/usr/local/bin/wp --allow-root --path=$WORDPRESS_ROOT"
while ! $WP_CLI db check; do
echo "waiting for the db to be ready"
sleep 1
done
if ! $WP_CLI core is-installed; then
echo "Install Wordpress"
$WP_CLI core install --url="$WP_URL" --title="$WP_TITLE" --admin_user="$WP_USER" --admin_password="$WP_PASS" --admin_email="$WP_EMAIL"
else
echo "Update DB"
$WP_CLI core update-db
fi