From 9f33f3487c433036abae7c1580b5ac8c2f4a2723 Mon Sep 17 00:00:00 2001 From: darksaid98 Date: Sat, 4 Jan 2025 08:08:36 +0100 Subject: [PATCH] fix(apps): mediawiki tweaks --- apps/mediawiki/Dockerfile | 67 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/apps/mediawiki/Dockerfile b/apps/mediawiki/Dockerfile index bb12297..ab342ff 100644 --- a/apps/mediawiki/Dockerfile +++ b/apps/mediawiki/Dockerfile @@ -1,10 +1,75 @@ -FROM --platform=$TARGETOS/$TARGETARCH mediawiki:1.42.4 +FROM --platform=$TARGETOS/$TARGETARCH php:8.1-fpm LABEL org.opencontainers.image.source="https://github.com/darksaid98/yolks" LABEL author="darksaid98" maintainer="darksaid9889@gmail.com" ENV DEBIAN_FRONTEND noninteractive +# System dependencies +RUN set -eux; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + git \ + librsvg2-bin \ + imagemagick \ + # Required for SyntaxHighlighting + python3 \ + ; \ + rm -rf /var/lib/apt/lists/* + +# Install the PHP extensions we need +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libicu-dev \ + libonig-dev \ + liblua5.1-0-dev \ + ; \ + \ + docker-php-ext-install -j "$(nproc)" \ + calendar \ + intl \ + mbstring \ + mysqli \ + opcache \ + ; \ + \ + pecl install APCu-5.1.24; \ + pecl install LuaSandbox-4.1.2; \ + docker-php-ext-enable \ + apcu \ + luasandbox \ + ; \ + rm -r /tmp/pear; \ + \ + # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + + +# set recommended PHP.ini settings +# see https://secure.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=60'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + RUN apt -y update && \ apt -y upgrade && \ apt -y install iproute2 && \