Update entrypoint-theme.sh with correct theme URL
parent
d6cac418a0
commit
679e5f2b02
41
Dockerfile
41
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"]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Reference in New Issue