From 679e5f2b02f4be5693182f8237dd8c5c80e06e0a Mon Sep 17 00:00:00 2001 From: RadioParalelo Date: Thu, 5 Mar 2026 09:45:20 +0000 Subject: [PATCH] Update entrypoint-theme.sh with correct theme URL --- Dockerfile | 41 ++++++++++++++--------------------------- docker-compose.yml | 7 +++---- entrypoint-theme.sh | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 entrypoint-theme.sh diff --git a/Dockerfile b/Dockerfile index 87818b1..7208e3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,51 +26,35 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli chmod +x wp-cli.phar && \ mv wp-cli.phar /usr/local/bin/wp -# ------------------------------------------------- -# 5️⃣ Copy WordPress core (triggered by official entrypoint later) -# ------------------------------------------------- WORKDIR /var/www/html # ------------------------------------------------- -# 6️⃣ Theme archive → proper theme folder +# Give www-data ownership of WP‑CLI cache folder # ------------------------------------------------- -COPY indy-wp/indywp.zip /tmp/indywp.zip -RUN unzip /tmp/indywp.zip -d /tmp && \ - mv /tmp/indywp /var/www/html/wp-content/themes/indywp && \ - rm /tmp/indywp.zip && \ - chown -R www-data:www-data /var/www/html/wp-content/themes/indywp && \ - chmod -R 755 /var/www/html/wp-content/themes/indywp +RUN mkdir -p /var/www/.wp-cli && chown -R www-data:www-data /var/www/.wp-cli # ------------------------------------------------- -# 7️⃣ Preset assets (optional) +# 5️⃣ (Removed) theme‑install step that caused the error # ------------------------------------------------- -COPY theme-assets/indywp/assets/ /var/www/html/wp-content/themes/indywp/assets/ -RUN chown -R www-data:www-data /var/www/html/wp-content/themes/indywp/assets && \ - chmod -R 644 /var/www/html/wp-content/themes/indywp/assets # ------------------------------------------------- -# 8️⃣ Writable uploads folder +# 6️⃣ Writable uploads folder # ------------------------------------------------- -RUN mkdir -p /var/www/html/wp-content/uploads && \ - chown -R www-data:www-data /var/www/html/wp-content && \ - chmod -R 775 /var/www/html/wp-content +RUN mkdir -p wp-content/uploads && \ + chown -R www-data:www-data wp-content && \ + chmod -R 775 wp-content # ------------------------------------------------- -# 8️⃣ Ensure plugins directory exists before Composer -# ------------------------------------------------- -RUN mkdir -p wp-content/plugins - -# ------------------------------------------------- -# 9️⃣ **Install plugins via Composer after core exists** +# 7️⃣ Composer‑based plugins (same as before) # ------------------------------------------------- COPY composer.json composer.lock ./ RUN composer install --no-dev --optimize-autoloader && \ rm composer.json composer.lock && \ - chown -R www-data:www-data /var/www/html/wp-content/plugins && \ - chmod -R 755 /var/www/html/wp-content/plugins + chown -R www-data:www-data wp-content/plugins && \ + chmod -R 755 wp-content/plugins # ------------------------------------------------- -# 🔟 Healthcheck +# 8️⃣ Healthcheck # ------------------------------------------------- HEALTHCHECK --interval=30s --timeout=5s \ CMD curl -f http://localhost/wp-admin/install.php || exit 1 @@ -83,5 +67,8 @@ EXPOSE 80 COPY entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/entrypoint.sh +COPY entrypoint-theme.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/entrypoint-theme.sh + ENTRYPOINT ["entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/docker-compose.yml b/docker-compose.yml index f908a46..29a1798 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,11 +11,10 @@ services: WORDPRESS_DB_PASSWORD: wp_pass WORDPRESS_DB_NAME: wp_db volumes: -# - ./wp-data/plugins:/var/www/html/wp-content/plugins - ./wp-data/uploads:/var/www/html/wp-content/uploads - ./config/php.ini:/usr/local/etc/php/conf.d/custom.ini:ro - ./theme/images:/var/www/html/wp-content/uploads/theme-images:ro - + entrypoint: ["/usr/local/bin/entrypoint-theme.sh"] db: image: mariadb:10.11 container_name: imc_db @@ -29,12 +28,12 @@ services: - ./db-data:/var/lib/mysql wpcli: - build: ./wpcli # <-- builds the Dockerfile in wpcli/ + build: ./wpcli depends_on: - wordpress - db entrypoint: ["/usr/local/bin/entrypoint.sh"] - command: ["wp"] # default command for WP‑CLI + command: ["wp"] environment: WP_CLI_URL: http://localhost:8080 WORDPRESS_DB_HOST: db diff --git a/entrypoint-theme.sh b/entrypoint-theme.sh new file mode 100644 index 0000000..dd2ef11 --- /dev/null +++ b/entrypoint-theme.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -e + +while [ ! -f /var/www/html/wp-config.php ]; do + echo "⏳ Waiting for WordPress core to be ready..." + sleep 2 +done + +# ---- Release‑page URL (no hyphen in file name) ---- +THEME_URL="https://github.com/RadioParalelo/indy-wp-theme/releases/download/v1.0.0/indywp.zip" + +echo "🚀 Installing the Indy‑WP theme..." +su www-data -s /bin/bash -c "\ + wp theme install $THEME_URL \ + --activate \ + --allow-root \ + --skip-themes \ + --force \ + --path=/var/www/html \ +" + +exec docker-entrypoint.sh apache2-foreground