#!/bin/bash set -euo pipefail ################################################################################ # ONE-TIME Duplicator restore ################################################################################ if [ ! -f /var/www/html/wp-content/.duplicator_restored ]; then echo "▶ First run – copy Duplicator package" mkdir -p /var/www/html cp -r /usr/src/duplicator/* /var/www/html/ chown -R www-data:www-data /var/www/html touch /var/www/html/wp-content/.duplicator_restored echo "✓ Package placed – browse /installer.php to finish the restore" fi ################################################################################ # ALWAYS sync the code we keep under version control ################################################################################ echo "▶ Syncing version-controlled themes" rsync -a --delete /usr/src/themes/ /var/www/html/wp-content/themes/ ################################################################################ # (optional) run safe automatic DB migrations, plugin installs, etc. # wp core update-db --yes # wp plugin update --all --quiet ################################################################################ # Hand back to the real WP entrypoint exec /usr/local/bin/docker-entrypoint-upstream.sh "$@"