Dockerfile (3124B)
1 ARG MEDIAWIKI_VERSION=1.45.3 2 FROM mediawiki:${MEDIAWIKI_VERSION} AS mediawiki-src 3 4 # Clone extensions not shipped in the MW tarball 5 RUN apt-get update && apt-get install -y --no-install-recommends git \ 6 && git clone --depth 1 --branch REL1_45 \ 7 https://github.com/wikimedia/mediawiki-extensions-CodeMirror.git \ 8 /var/www/html/extensions/CodeMirror \ 9 && rm -rf /var/www/html/extensions/CodeMirror/.git \ 10 && for EXT in \ 11 ArticleCreationWorkflow \ 12 Babel \ 13 BetaFeatures \ 14 ContactPage \ 15 CreditsSource \ 16 Disambiguator \ 17 GuidedTour \ 18 NearbyPages \ 19 MobileFrontend \ 20 ReadingLists \ 21 RelatedArticles \ 22 RevisionSlider \ 23 RSS \ 24 TorBlock \ 25 ParserFunctions \ 26 Scribunto \ 27 JsonConfig \ 28 Translate \ 29 UniversalLanguageSelector \ 30 MediaUploader \ 31 AutoCreateCategoryPages \ 32 HitCounters \ 33 ; do \ 34 git clone --depth 1 --branch REL1_45 \ 35 "https://gerrit.wikimedia.org/r/mediawiki/extensions/${EXT}" \ 36 "/var/www/html/extensions/${EXT}" \ 37 && rm -rf "/var/www/html/extensions/${EXT}/.git"; \ 38 done \ 39 && git clone --depth 1 --branch REL1_45 \ 40 https://gerrit.wikimedia.org/r/mediawiki/extensions/cldr \ 41 /var/www/html/extensions/CLDR \ 42 && rm -rf /var/www/html/extensions/CLDR/.git \ 43 && git clone --depth 1 \ 44 https://gerrit.wikimedia.org/r/mediawiki/extensions/GPGMail \ 45 /var/www/html/extensions/GPGMail \ 46 && rm -rf /var/www/html/extensions/GPGMail/.git \ 47 && apt-get purge -y git && apt-get autoremove -y \ 48 && rm -rf /var/lib/apt/lists/* 49 50 FROM php:8.3-fpm-bookworm 51 52 # Slow stable layer: compile PHP extensions (only changes if extensions/versions change) 53 RUN apt-get update && apt-get install -y --no-install-recommends \ 54 libicu-dev \ 55 libonig-dev \ 56 liblua5.1-dev \ 57 && docker-php-ext-install -j$(nproc) calendar intl mbstring mysqli opcache \ 58 && pecl install apcu redis LuaSandbox \ 59 && docker-php-ext-enable apcu redis luasandbox \ 60 && apt-get purge -y --auto-remove libicu-dev libonig-dev liblua5.1-dev \ 61 && rm -rf /var/lib/apt/lists/* /tmp/pear 62 63 # Runtime packages + Apache (add new deps here without busting the layer above) 64 RUN apt-get update && apt-get install -y --no-install-recommends \ 65 apache2 \ 66 ghostscript \ 67 gnupg \ 68 imagemagick \ 69 librsvg2-bin \ 70 poppler-utils \ 71 python3-pygments \ 72 && a2enmod rewrite proxy_fcgi setenvif mpm_event headers \ 73 && a2dismod mpm_prefork || true \ 74 && rm -rf /var/lib/apt/lists/* 75 76 COPY --from=mediawiki-src /var/www/html /var/www/html 77 COPY --from=mediawiki-src /var/www/data /var/www/data 78 79 COPY apache-vhost.conf /etc/apache2/sites-enabled/000-default.conf 80 COPY apache-fpm.conf /etc/apache2/conf-enabled/php-fpm.conf 81 COPY fpm-pool.conf /usr/local/etc/php-fpm.d/zz-mediawiki.conf 82 COPY php-custom.ini /usr/local/etc/php/conf.d/zz-mediawiki-custom.ini 83 COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh 84 85 RUN chmod +x /usr/local/bin/docker-entrypoint.sh 86 87 EXPOSE 80 88 CMD ["/usr/local/bin/docker-entrypoint.sh"]