#!/bin/sh set -eu environment="${WP_ENVIRONMENT_TYPE:-local}" case "$environment" in local | development | staging) ;; production) password="${WORDPRESS_DB_PASSWORD:-}" case "$password" in "" | *replace-with*) echo "A non-placeholder WORDPRESS_DB_PASSWORD is required in production." >&2 exit 1 ;; esac if [ "${#password}" -lt 16 ]; then echo "WORDPRESS_DB_PASSWORD must contain at least 16 characters in production." >&2 exit 1 fi ;; *) echo "WP_ENVIRONMENT_TYPE must be local, development, staging, or production." >&2 exit 1 ;; esac if [ "${1:-}" = "apache2-foreground" ]; then mkdir -p /var/www/html/wp-content/themes /var/www/html/wp-content/mu-plugins rm -rf /var/www/html/wp-content/themes/azionelab cp -a /opt/azionelab/theme /var/www/html/wp-content/themes/azionelab cp /opt/azionelab/azionelab-content.php /var/www/html/wp-content/mu-plugins/azionelab-content.php if [ ! -e /var/www/html/.htaccess ]; then cp /opt/azionelab/.htaccess /var/www/html/.htaccess fi chown -R www-data:www-data \ /var/www/html/wp-content/themes/azionelab \ /var/www/html/wp-content/mu-plugins/azionelab-content.php \ /var/www/html/.htaccess fi exec docker-entrypoint.sh "$@"