cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

Dockerfile (10749B)


      1 # Use Ubuntu as the base image
      2 # {"$imagepolicy": "flux-system:docker-ubuntu-25"}
      3 FROM ubuntu:25.10@sha256:4a9232cc47bf99defcc8860ef6222c99773330367fcecbf21ba2edb0b810a31e
      4 
      5 # Non-interactive frontend for apt and set timezone
      6 ARG DEBIAN_FRONTEND=noninteractive
      7 ENV TZ=UTC
      8 
      9 # Install common packages, nginx, php and tools in a single layer for smaller image
     10 RUN apt-get update \
     11     && apt-get install -y --no-install-recommends \
     12     ca-certificates \
     13     gnupg \
     14     lsb-release \
     15     nginx \
     16     curl \
     17     wget \
     18     unzip \
     19     sudo \
     20     imagemagick \
     21     php8.4 \
     22     php8.4-fpm \
     23     #php8.4-mysql \
     24     php8.4-mysqlnd \
     25     php8.4-cli \
     26     php8.4-opcache \
     27     php8.4-exif \
     28     php8.4-gd \
     29     php8.4-curl \
     30     php8.4-dom \
     31     php8.4-imagick \
     32     php8.4-mbstring \
     33     php8.4-igbinary \
     34     php8.4-zip \
     35     php8.4-intl \
     36     php8.4-bz2 \
     37     php8.4-redis \
     38     php8.4-apcu \
     39     php8.4-bcmath \
     40     redis-server cron less nano \
     41     && rm -rf /var/lib/apt/lists/*
     42 
     43 # Enable PHP extensions
     44 RUN phpenmod -v 8.4 -s fpm \
     45     redis apcu exif gettext \
     46     iconv opcache bz2 igbinary curl dom \
     47     intl gd imagick mbstring zip mysqlnd curl \
     48     bcmath calendar ctype posix xmlreader xmlwriter sockets ffi xml readline
     49 
     50 # Copy PHP ini and extension INI files before enabling them (cache layer friendly)
     51 COPY 20-apcu.ini /etc/php/8.4/mods-available/20-apcu.ini
     52 COPY 10-opcache.ini /etc/php/8.4/mods-available/10-opcache.ini
     53 COPY www.conf /etc/php/8.4/fpm/pool.d/www.conf
     54 COPY php.ini /etc/php/8.4/fpm/php.ini
     55 
     56 # Install WordPress into the webroot
     57 RUN wget -q https://wordpress.org/latest.zip \
     58     && unzip -q latest.zip -d /var/www/html/ \
     59     && rm latest.zip
     60 
     61 # Install twenty-twenty-five theme
     62 RUN wget -q https://downloads.wordpress.org/theme/twentytwentyfive.1.4.zip \
     63     && unzip -q -o twentytwentyfive.1.4.zip -d /var/www/html/wordpress/wp-content/themes/ \
     64     && rm twentytwentyfive.1.4.zip
     65 
     66 # Install WP Super Cache plugin
     67 RUN wget -q https://downloads.wordpress.org/plugin/wp-super-cache.3.1.0.zip \
     68     && unzip -q wp-super-cache.3.1.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     69     && rm wp-super-cache.3.1.0.zip
     70 # Install Redis Object Cache plugin
     71 RUN wget -q https://downloads.wordpress.org/plugin/redis-cache.2.7.0.zip \
     72     && unzip -q redis-cache.2.7.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     73     && rm redis-cache.2.7.0.zip
     74 # Install ActivityPub plugin
     75 RUN wget -q https://downloads.wordpress.org/plugin/activitypub.8.1.1.zip \
     76     && unzip -q activitypub.8.1.1.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     77     && rm activitypub.8.1.1.zip
     78 # Install Embed Optimizer
     79 RUN wget -q https://downloads.wordpress.org/plugin/embed-optimizer.1.0.0-beta5.zip \
     80     && unzip -q embed-optimizer.1.0.0-beta5.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     81     && rm embed-optimizer.1.0.0-beta5.zip
     82 # Install Enhanced Responsive Images
     83 RUN wget -q https://downloads.wordpress.org/plugin/auto-sizes.1.7.0.zip \
     84     && unzip -q auto-sizes.1.7.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     85     && rm auto-sizes.1.7.0.zip
     86 # Install Friends
     87 RUN wget -q https://downloads.wordpress.org/plugin/friends.4.0.5.zip \
     88     && unzip -q friends.4.0.5.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     89     && rm friends.4.0.5.zip
     90 # Install Image Placeholders
     91 RUN wget -q https://downloads.wordpress.org/plugin/dominant-color-images.1.2.1.zip \
     92     && unzip -q dominant-color-images.1.2.1.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     93     && rm dominant-color-images.1.2.1.zip
     94 # Install Image Prioritizer
     95 RUN wget -q https://downloads.wordpress.org/plugin/image-prioritizer.1.0.0-beta3.zip \
     96     && unzip -q image-prioritizer.1.0.0-beta3.zip -d /var/www/html/wordpress/wp-content/plugins/ \
     97     && rm image-prioritizer.1.0.0-beta3.zip
     98 # Install Index WP MySQL For Speed
     99 RUN wget -q https://downloads.wordpress.org/plugin/index-wp-mysql-for-speed.1.5.6.zip \
    100     && unzip -q index-wp-mysql-for-speed.1.5.6.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    101     && rm index-wp-mysql-for-speed.1.5.6.zip
    102 # Install Modern Image Formats
    103 RUN wget -q https://downloads.wordpress.org/plugin/webp-uploads.2.6.1.zip \
    104     && unzip -q webp-uploads.2.6.1.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    105     && rm webp-uploads.2.6.1.zip
    106 # Install Optimization Detective
    107 RUN wget -q https://downloads.wordpress.org/plugin/optimization-detective.1.0.0-beta5.zip \
    108     && unzip -q optimization-detective.1.0.0-beta5.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    109     && rm optimization-detective.1.0.0-beta5.zip
    110 # Install Performance Lab
    111 RUN wget -q https://downloads.wordpress.org/plugin/performance-lab.4.1.0.zip \
    112     && unzip -q performance-lab.4.1.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    113     && rm performance-lab.4.1.0.zip
    114 # Install Speculative Loading
    115 RUN wget -q https://downloads.wordpress.org/plugin/speculation-rules.1.6.0.zip \
    116     && unzip -q speculation-rules.1.6.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    117     && rm speculation-rules.1.6.0.zip
    118 # Install WP Mail SMTP
    119 #RUN wget -q https://downloads.wordpress.org/plugin/wp-mail-smtp.4.6.0.zip \
    120 #    && unzip -q wp-mail-smtp.4.6.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    121 #    && rm wp-mail-smtp.4.6.0.zip
    122 
    123 # Install Simply Gallery Block
    124 #RUN wget -q https://downloads.wordpress.org/plugin/simply-gallery-block.3.2.8.zip \
    125 #    && unzip -q simply-gallery-block.3.2.8.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    126 #    && rm simply-gallery-block.3.2.8.zip
    127 
    128 # Install Plausible Analytics
    129 RUN wget -q https://downloads.wordpress.org/plugin/plausible-analytics.latest-stable.zip \
    130     && unzip -q plausible-analytics.latest-stable.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    131     && rm plausible-analytics.latest-stable.zip
    132 
    133 # Install Public Post Preview
    134 RUN wget -q https://downloads.wordpress.org/plugin/public-post-preview.3.1.0.zip \
    135     && unzip -q public-post-preview.3.1.0.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    136     && rm public-post-preview.3.1.0.zip
    137 
    138 # Install Opengraph plugin
    139 RUN wget -q https://downloads.wordpress.org/plugin/opengraph.2.0.2.zip \
    140     && unzip -q opengraph.2.0.2.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    141     && rm opengraph.2.0.2.zip
    142 
    143 # Install surveyjs plugin
    144 RUN wget -q https://downloads.wordpress.org/plugin/surveyjs.zip \
    145     && unzip -q surveyjs.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    146     && rm surveyjs.zip
    147 
    148 # Install Stop User Enumeration plugin
    149 #RUN wget -q https://downloads.wordpress.org/plugin/stop-user-enumeration.1.7.5.zip \
    150 #    && unzip -q stop-user-enumeration.1.7.5.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    151 #    && rm stop-user-enumeration.1.7.5.zip
    152 
    153 # Install Antispam Bee plugin
    154 RUN wget -q https://downloads.wordpress.org/plugin/antispam-bee.2.11.10.zip \
    155     && unzip -q antispam-bee.2.11.10.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    156     && rm antispam-bee.2.11.10.zip
    157 
    158 # Install Gallery Block Lightbox plugin
    159 RUN wget -q https://downloads.wordpress.org/plugin/gallery-block-lightbox.zip \
    160     && unzip -q gallery-block-lightbox.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    161     && rm gallery-block-lightbox.zip
    162 
    163 # Install Complianz
    164 #RUN wget -q https://downloads.wordpress.org/plugin/complianz-gdpr.7.4.3.zip \
    165 #    && unzip -q complianz-gdpr.7.4.3.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    166 #    && rm complianz-gdpr.7.4.3.zip
    167 
    168 # Install Google XML Sitemaps
    169 RUN wget -q https://downloads.wordpress.org/plugin/google-sitemap-generator.4.1.23.zip \
    170     && unzip -q google-sitemap-generator.4.1.23.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    171     && rm google-sitemap-generator.4.1.23.zip
    172 
    173 # Install Akismet
    174 RUN wget -q https://downloads.wordpress.org/plugin/akismet.5.7.zip \
    175     && unzip -q -o akismet.5.7.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    176     && rm akismet.5.7.zip
    177 
    178 # Install Podlove Publisher
    179 RUN wget -q https://downloads.wordpress.org/plugin/podlove-podcasting-plugin-for-wordpress.4.4.2.zip \
    180     && unzip -q -o podlove-podcasting-plugin-for-wordpress.4.4.2.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    181     && rm podlove-podcasting-plugin-for-wordpress.4.4.2.zip
    182 
    183 # Install Podlove Web Player
    184 RUN wget -q https://downloads.wordpress.org/plugin/podlove-web-player.5.9.2.zip \
    185     && unzip -q -o podlove-web-player.5.9.2.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    186     && rm podlove-web-player.5.9.2.zip
    187 
    188 # Install Podlove Subscribe button
    189 RUN wget -q https://downloads.wordpress.org/plugin/podlove-subscribe-button.1.3.12.zip \
    190     && unzip -q -o podlove-subscribe-button.1.3.12.zip -d /var/www/html/wordpress/wp-content/plugins/ \
    191     && rm podlove-subscribe-button.1.3.12.zip
    192 
    193 # Configure nginx: replace default site and enable wordpress config
    194 RUN rm -f /etc/nginx/sites-enabled/default
    195 COPY wordpress.conf /etc/nginx/sites-available/wordpress.conf
    196 COPY nginx.conf /etc/nginx/nginx.conf
    197 RUN ln -s /etc/nginx/sites-available/wordpress.conf /etc/nginx/sites-enabled/wordpress.conf
    198 
    199 # Copy redis config and well-known files
    200 COPY redis.conf /redis.conf
    201 
    202 COPY wellknown/client.json /var/www/html/well-known/client
    203 COPY wellknown/server.json /var/www/html/well-known/server
    204 COPY wellknown/support.json /var/www/html/well-known/support.json
    205 
    206 # Add WordPress configuration and cache files
    207 RUN rm -f /var/www/html/wordpress/wp-config-sample.php
    208 COPY wp-config.php /var/www/html/wordpress/wp-config.php
    209 COPY advanced-cache.php /var/www/html/wordpress/wp-content/advanced-cache.php
    210 COPY wp-cache-config.php /var/www/html/wordpress/wp-content/wp-cache-config.php
    211 COPY object-cache.php /var/www/html/wordpress/wp-content/object-cache.php
    212 COPY opcache-preload.php /var/www/html/wordpress/opcache-preload.php
    213 
    214 # Fix permissions for the webroot
    215 RUN chown -R www-data:www-data /var/www/ \
    216     && chmod -R 755 /var/www/
    217 
    218 # Install WP-CLI
    219 RUN curl -fsSL -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
    220     && chmod +x /usr/local/bin/wp
    221 
    222 # Expose HTTP port
    223 EXPOSE 8080
    224 
    225 # Copy startup script and make it executable
    226 COPY startup.sh /usr/local/bin/startup.sh
    227 RUN chmod +x /usr/local/bin/startup.sh
    228 
    229 # Add cronjob: every 10 minutes, run wp-cron.php via curl as www-data
    230 # Note: cron files in /etc/cron.d must have the user field
    231 RUN printf '*/10 * * * * www-data curl -fsS --retry 3 https://mtrnord.blog/wp-cron.php > /dev/null 2>&1\n' > /etc/cron.d/wp-cron \
    232     && chmod 0644 /etc/cron.d/wp-cron
    233 
    234 # Ensure cron runs alongside the startup script
    235 RUN printf '#!/bin/sh\ncron && exec "$@"\n' > /usr/local/bin/with-cron.sh && chmod +x /usr/local/bin/with-cron.sh
    236 
    237 # Default command: run cron helper then startup
    238 CMD ["/usr/local/bin/with-cron.sh", "/usr/local/bin/startup.sh"]