2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 0️⃣ Base image – official WordPress (PHP 8.2 + Apache)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
FROM wordpress:php8.2-apache
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 1️⃣ Remove bundled themes (optional)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
RUN rm -rf /usr/src/wordpress/wp-content/themes/*
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 2️⃣ PHP configuration (optional – increase limits)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
COPY config/php.ini /usr/local/etc/php/conf.d/custom.ini
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 3️⃣ System utilities + mariadb client (for DB check)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
RUN apt-get update && \
|
2026-03-05 00:12:31 +00:00
|
|
|
|
apt-get install -y --no-install-recommends unzip mariadb-client && \
|
2026-03-04 22:45:28 +00:00
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
|
|
curl -sS https://getcomposer.org/installer | \
|
|
|
|
|
|
php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 4️⃣ WP‑CLI (already used by your old entrypoint)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
|
|
|
|
|
|
chmod +x wp-cli.phar && \
|
|
|
|
|
|
mv wp-cli.phar /usr/local/bin/wp
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 5️⃣ Composer‑based plugins
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
|
|
COPY composer.json composer.lock ./
|
|
|
|
|
|
RUN composer install --no-dev --optimize-autoloader && \
|
|
|
|
|
|
rm composer.json composer.lock
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 6️⃣ Theme & media (your existing copies)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
COPY indy-wp/indywp/ /var/www/html/wp-content/themes/indywp/
|
2026-03-04 23:53:49 +00:00
|
|
|
|
COPY indy-wp/media/ /var/www/html/wp-content/uploads/2026/03/
|
2026-03-05 00:12:31 +00:00
|
|
|
|
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 7️⃣ Export file – the XML you exported from WP
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
COPY export/indymedia.WordPress.xml /tmp/site-export.xml
|
2026-03-04 22:45:28 +00:00
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 8️⃣ Permissions for wp‑content
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 9️⃣ Custom entrypoint (wrapper)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
|
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
2026-03-04 22:45:28 +00:00
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 🔟 Healthcheck (optional)
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s \
|
|
|
|
|
|
CMD curl -f http://localhost/wp-admin/install.php || exit 1
|
|
|
|
|
|
|
2026-03-04 22:45:28 +00:00
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
# 🚀 Use the wrapper, then the original entrypoint
|
2026-03-04 22:45:28 +00:00
|
|
|
|
# -------------------------------------------------
|
2026-03-05 00:12:31 +00:00
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
2026-03-04 22:45:28 +00:00
|
|
|
|
CMD ["apache2-foreground"]
|