mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2025-02-08 21:19:25 +01:00
26 lines
870 B
Plaintext
26 lines
870 B
Plaintext
#!/usr/bin/with-contenv bash
|
|
set -e
|
|
|
|
DISABLE_WP_UPDATES="${ENFORCE_DISABLE_WP_UPDATES:-true}"
|
|
|
|
# Designed to replace original, overcomplicated entrypoint script from official wordpress docker repository
|
|
# Why not use already available tools instead?!
|
|
|
|
function wp() {
|
|
# Running as root in container is OK as long as all security implications are observed and maintained
|
|
/usr/local/bin/wp --allow-root "$@"
|
|
}
|
|
|
|
echo "> Verifying 'WordPress ${WP_VERSION}' installation..."
|
|
if wp core version;
|
|
then
|
|
echo "> Identified 'WordPress ${WP_VERSION}'"
|
|
else
|
|
echo "> Downloading 'WordPress ${WP_VERSION}'..."
|
|
wp core download --locale="${WP_LOCALE}" --version="${WP_VERSION}"
|
|
|
|
if [ "${DISABLE_WP_UPDATES}" != "false" ]; then
|
|
echo "> Disabling WordPress updates..."
|
|
patch /var/www/html/wp-admin/update-core.php < /etc/wp-mods/wp-admin/update-core.php.patch
|
|
fi
|
|
fi |