#!/usr/bin/env bash set -e # ------------------------------------------------- # Wait until WordPress core (wp-config.php) exists # ------------------------------------------------- while [ ! -f /var/www/html/wp-config.php ]; do echo "⏳ Waiting for WordPress core to be ready..." sleep 2 done # ------------------------------------------------- # Download & install the custom theme # ------------------------------------------------- THEME_ZIP="https://codeberg.org/radioparalelo/indy-wp-theme/archive/main.zip" TMP_DIR=$(mktemp -d) echo "🚀 Downloading Indy‑WP theme archive..." curl -L "$THEME_ZIP" -o "$TMP_DIR/main.zip" echo "🔧 Extracting archive..." unzip -q "$TMP_DIR/main.zip" -d "$TMP_DIR" EXTRACTED=$(find "$TMP_DIR" -maxdepth 1 -type d -name "indy-wp-theme*" | head -n1) TARGET="/var/www/html/wp-content/themes/indywp" rm -rf "$TARGET" mv "$EXTRACTED" "$TARGET" rm -rf "$TMP_DIR" # ------------------------------------------------- # Activate the theme (force) # ------------------------------------------------- su www-data -s /bin/bash -c "\ wp theme activate indywp \ --allow-root \ --path=/var/www/html \ " # ------------------------------------------------- # Hand over to the official entrypoint (starts Apache) # ------------------------------------------------- exec /usr/local/bin/docker-entrypoint.sh "$@"