wordpress/rootfs/etc/cont-init.d/10-init-wordpress
2020-06-17 01:37:45 +02:00

26 lines
819 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..."
cp "/etc/wp-mods" "/var/www/html" -r -T
fi
fi