├── .editorconfig ├── LICENSE ├── .github └── workflows │ ├── build.yml │ └── update.yml ├── README.md ├── 1.39 ├── fpm-alpine │ └── Dockerfile ├── fpm │ └── Dockerfile └── apache │ └── Dockerfile ├── 1.43 ├── fpm-alpine │ └── Dockerfile ├── fpm │ └── Dockerfile └── apache │ └── Dockerfile ├── 1.44 ├── fpm-alpine │ └── Dockerfile ├── fpm │ └── Dockerfile └── apache │ └── Dockerfile ├── 1.45 ├── fpm-alpine │ └── Dockerfile ├── fpm │ └── Dockerfile └── apache │ └── Dockerfile ├── Dockerfile-alpine.template ├── Dockerfile-debian.template └── update.py /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | tab_width = 4 6 | end_of_line = lf 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | tab_width = 2 13 | 14 | [*.py] 15 | indent_style = space 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Original work by Synctree, Inc. and available at: 2 | https://github.com/synctree/docker-mediawiki 3 | 4 | Copyright 2015 Benjamin Hutchins 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Docker Build 2 | on: 3 | pull_request: 4 | push: 5 | 6 | defaults: 7 | run: 8 | shell: bash 9 | 10 | jobs: 11 | lookup-versions: 12 | runs-on: ubuntu-latest 13 | 14 | outputs: 15 | versions: ${{ steps.versions.outputs.versions }} 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Get current versions 19 | id: versions 20 | run: | 21 | echo "versions=$(python -c 'import glob, json; print(json.dumps(glob.glob("1.*")))')" | tee $GITHUB_OUTPUT 22 | 23 | build: 24 | runs-on: ubuntu-latest 25 | 26 | needs: 27 | - lookup-versions 28 | strategy: 29 | matrix: 30 | version: ${{ fromJson(needs.lookup-versions.outputs.versions) }} 31 | type: [apache, fpm, fpm-alpine] 32 | 33 | steps: 34 | - uses: actions/checkout@v4 35 | - run: docker build ./${{ matrix.version }}/${{ matrix.type }} 36 | -------------------------------------------------------------------------------- /.github/workflows/update.yml: -------------------------------------------------------------------------------- 1 | name: Update 2 | on: 3 | schedule: 4 | - cron: '0 0 * * *' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | update: 9 | runs-on: ubuntu-latest 10 | container: debian:bookworm 11 | env: 12 | GH_TOKEN: ${{ github.token }} 13 | 14 | steps: 15 | - name: Install dependencies 16 | run: | 17 | apt-get update && apt-get install --yes --no-install-recommends python3 git gh ca-certificates 18 | - uses: actions/checkout@v4 19 | - name: Run update 20 | run: | 21 | # without re-setting the safe.directory config options all git 22 | # commands error out, even though this should be already be set by 23 | # actions/checkout. 24 | git config --global --add safe.directory "$GITHUB_WORKSPACE" 25 | git config --global user.email "cool-updating-bot@mediawiki.org" 26 | git config --global user.name "Cool updating bot" 27 | gh repo set-default wikimedia/mediawiki-docker 28 | git checkout -b auto-update 29 | ./update.py --commit --pr 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About this Repo 2 | 3 | This is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [mediawiki](https://registry.hub.docker.com/_/mediawiki/). See [the Docker Hub page](https://registry.hub.docker.com/_/mediawiki/) for the full readme on how to use this Docker image and for information regarding contributing and issues. 4 | 5 | The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specifically in [docker-library/docs/mediawiki](https://github.com/docker-library/docs/tree/master/mediawiki). 6 | 7 | Do not edit the `Dockerfile`s directly. Changes should be made in the `Dockerfile-*.template` files and applied by running `update.py`. 8 | The project is also running `update.py` via a scheduled github action once per day. 9 | 10 | See a change merged here that doesn't show up on the Docker Hub yet? Check [the "library/mediawiki" manifest file in the docker-library/official-images repo](https://github.com/docker-library/official-images/blob/master/library/mediawiki), especially [PRs with the "library/mediawiki" label on that repo](https://github.com/docker-library/official-images/labels/library%2Fmediawiki). For more information about the official images process, see the [docker-library/official-images readme](https://github.com/docker-library/official-images/blob/master/README.md). 11 | 12 | Please file bug reports on [Phabricator](https://phabricator.wikimedia.org/project/view/3094/) and not on GitHub. 13 | 14 | -------------------------------------------------------------------------------- /1.39/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm-alpine 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apk add --no-cache \ 7 | git \ 8 | imagemagick \ 9 | # Required for SyntaxHighlighting 10 | python3 \ 11 | ; 12 | 13 | # Install the PHP extensions we need 14 | RUN set -eux; \ 15 | \ 16 | apk add --no-cache --virtual .build-deps \ 17 | $PHPIZE_DEPS \ 18 | icu-dev \ 19 | lua5.1-dev \ 20 | oniguruma-dev \ 21 | ; \ 22 | \ 23 | docker-php-ext-install -j "$(nproc)" \ 24 | calendar \ 25 | intl \ 26 | mbstring \ 27 | mysqli \ 28 | opcache \ 29 | ; \ 30 | \ 31 | pecl install APCu-5.1.28; \ 32 | pecl install LuaSandbox-4.1.2; \ 33 | docker-php-ext-enable \ 34 | apcu \ 35 | luasandbox \ 36 | ; \ 37 | rm -r /tmp/pear; \ 38 | \ 39 | runDeps="$( \ 40 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 41 | | tr ',' '\n' \ 42 | | sort -u \ 43 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 44 | )"; \ 45 | apk add --no-network --virtual .mediawiki-phpext-rundeps $runDeps; \ 46 | apk del --no-network .build-deps 47 | 48 | # set recommended PHP.ini settings 49 | # see https://secure.php.net/manual/en/opcache.installation.php 50 | RUN { \ 51 | echo 'opcache.memory_consumption=128'; \ 52 | echo 'opcache.interned_strings_buffer=8'; \ 53 | echo 'opcache.max_accelerated_files=4000'; \ 54 | echo 'opcache.revalidate_freq=60'; \ 55 | echo 'opcache.fast_shutdown=1'; \ 56 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 57 | 58 | # SQLite Directory Setup 59 | RUN set -eux; \ 60 | mkdir -p /var/www/data; \ 61 | chown -R www-data:www-data /var/www/data 62 | 63 | # Version 64 | ENV MEDIAWIKI_MAJOR_VERSION=1.39 65 | ENV MEDIAWIKI_VERSION=1.39.17 66 | 67 | # MediaWiki setup 68 | RUN set -eux; \ 69 | apk add --no-cache --virtual .fetch-deps \ 70 | bzip2 \ 71 | gnupg \ 72 | ; \ 73 | \ 74 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 75 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 76 | export GNUPGHOME="$(mktemp -d)"; \ 77 | # gpg key from https://www.mediawiki.org/keys/keys.txt 78 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 79 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 80 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 81 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 82 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 83 | E059C034E7A430583C252F4AA8F734246D73B586 \ 84 | ; \ 85 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 86 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 87 | gpgconf --kill all; \ 88 | rm -rf "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 89 | chown -R www-data:www-data extensions skins cache images; \ 90 | \ 91 | apk del --no-network .fetch-deps 92 | 93 | CMD ["php-fpm"] 94 | -------------------------------------------------------------------------------- /1.43/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm-alpine 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apk add --no-cache \ 7 | git \ 8 | imagemagick \ 9 | # Required for SyntaxHighlighting 10 | python3 \ 11 | ; 12 | 13 | # Install the PHP extensions we need 14 | RUN set -eux; \ 15 | \ 16 | apk add --no-cache --virtual .build-deps \ 17 | $PHPIZE_DEPS \ 18 | icu-dev \ 19 | lua5.1-dev \ 20 | oniguruma-dev \ 21 | ; \ 22 | \ 23 | docker-php-ext-install -j "$(nproc)" \ 24 | calendar \ 25 | intl \ 26 | mbstring \ 27 | mysqli \ 28 | opcache \ 29 | ; \ 30 | \ 31 | pecl install APCu-5.1.28; \ 32 | pecl install LuaSandbox-4.1.2; \ 33 | docker-php-ext-enable \ 34 | apcu \ 35 | luasandbox \ 36 | ; \ 37 | rm -r /tmp/pear; \ 38 | \ 39 | runDeps="$( \ 40 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 41 | | tr ',' '\n' \ 42 | | sort -u \ 43 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 44 | )"; \ 45 | apk add --no-network --virtual .mediawiki-phpext-rundeps $runDeps; \ 46 | apk del --no-network .build-deps 47 | 48 | # set recommended PHP.ini settings 49 | # see https://secure.php.net/manual/en/opcache.installation.php 50 | RUN { \ 51 | echo 'opcache.memory_consumption=128'; \ 52 | echo 'opcache.interned_strings_buffer=8'; \ 53 | echo 'opcache.max_accelerated_files=4000'; \ 54 | echo 'opcache.revalidate_freq=60'; \ 55 | echo 'opcache.fast_shutdown=1'; \ 56 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 57 | 58 | # SQLite Directory Setup 59 | RUN set -eux; \ 60 | mkdir -p /var/www/data; \ 61 | chown -R www-data:www-data /var/www/data 62 | 63 | # Version 64 | ENV MEDIAWIKI_MAJOR_VERSION=1.43 65 | ENV MEDIAWIKI_VERSION=1.43.6 66 | 67 | # MediaWiki setup 68 | RUN set -eux; \ 69 | apk add --no-cache --virtual .fetch-deps \ 70 | bzip2 \ 71 | gnupg \ 72 | ; \ 73 | \ 74 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 75 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 76 | export GNUPGHOME="$(mktemp -d)"; \ 77 | # gpg key from https://www.mediawiki.org/keys/keys.txt 78 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 79 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 80 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 81 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 82 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 83 | E059C034E7A430583C252F4AA8F734246D73B586 \ 84 | ; \ 85 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 86 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 87 | gpgconf --kill all; \ 88 | rm -rf "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 89 | chown -R www-data:www-data extensions skins cache images; \ 90 | \ 91 | apk del --no-network .fetch-deps 92 | 93 | CMD ["php-fpm"] 94 | -------------------------------------------------------------------------------- /1.44/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm-alpine 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apk add --no-cache \ 7 | git \ 8 | imagemagick \ 9 | # Required for SyntaxHighlighting 10 | python3 \ 11 | ; 12 | 13 | # Install the PHP extensions we need 14 | RUN set -eux; \ 15 | \ 16 | apk add --no-cache --virtual .build-deps \ 17 | $PHPIZE_DEPS \ 18 | icu-dev \ 19 | lua5.1-dev \ 20 | oniguruma-dev \ 21 | ; \ 22 | \ 23 | docker-php-ext-install -j "$(nproc)" \ 24 | calendar \ 25 | intl \ 26 | mbstring \ 27 | mysqli \ 28 | opcache \ 29 | ; \ 30 | \ 31 | pecl install APCu-5.1.28; \ 32 | pecl install LuaSandbox-4.1.2; \ 33 | docker-php-ext-enable \ 34 | apcu \ 35 | luasandbox \ 36 | ; \ 37 | rm -r /tmp/pear; \ 38 | \ 39 | runDeps="$( \ 40 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 41 | | tr ',' '\n' \ 42 | | sort -u \ 43 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 44 | )"; \ 45 | apk add --no-network --virtual .mediawiki-phpext-rundeps $runDeps; \ 46 | apk del --no-network .build-deps 47 | 48 | # set recommended PHP.ini settings 49 | # see https://secure.php.net/manual/en/opcache.installation.php 50 | RUN { \ 51 | echo 'opcache.memory_consumption=128'; \ 52 | echo 'opcache.interned_strings_buffer=8'; \ 53 | echo 'opcache.max_accelerated_files=4000'; \ 54 | echo 'opcache.revalidate_freq=60'; \ 55 | echo 'opcache.fast_shutdown=1'; \ 56 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 57 | 58 | # SQLite Directory Setup 59 | RUN set -eux; \ 60 | mkdir -p /var/www/data; \ 61 | chown -R www-data:www-data /var/www/data 62 | 63 | # Version 64 | ENV MEDIAWIKI_MAJOR_VERSION=1.44 65 | ENV MEDIAWIKI_VERSION=1.44.3 66 | 67 | # MediaWiki setup 68 | RUN set -eux; \ 69 | apk add --no-cache --virtual .fetch-deps \ 70 | bzip2 \ 71 | gnupg \ 72 | ; \ 73 | \ 74 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 75 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 76 | export GNUPGHOME="$(mktemp -d)"; \ 77 | # gpg key from https://www.mediawiki.org/keys/keys.txt 78 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 79 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 80 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 81 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 82 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 83 | E059C034E7A430583C252F4AA8F734246D73B586 \ 84 | ; \ 85 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 86 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 87 | gpgconf --kill all; \ 88 | rm -rf "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 89 | chown -R www-data:www-data extensions skins cache images; \ 90 | \ 91 | apk del --no-network .fetch-deps 92 | 93 | CMD ["php-fpm"] 94 | -------------------------------------------------------------------------------- /1.45/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm-alpine 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apk add --no-cache \ 7 | git \ 8 | imagemagick \ 9 | # Required for SyntaxHighlighting 10 | python3 \ 11 | ; 12 | 13 | # Install the PHP extensions we need 14 | RUN set -eux; \ 15 | \ 16 | apk add --no-cache --virtual .build-deps \ 17 | $PHPIZE_DEPS \ 18 | icu-dev \ 19 | lua5.1-dev \ 20 | oniguruma-dev \ 21 | ; \ 22 | \ 23 | docker-php-ext-install -j "$(nproc)" \ 24 | calendar \ 25 | intl \ 26 | mbstring \ 27 | mysqli \ 28 | opcache \ 29 | ; \ 30 | \ 31 | pecl install APCu-5.1.28; \ 32 | pecl install LuaSandbox-4.1.2; \ 33 | docker-php-ext-enable \ 34 | apcu \ 35 | luasandbox \ 36 | ; \ 37 | rm -r /tmp/pear; \ 38 | \ 39 | runDeps="$( \ 40 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 41 | | tr ',' '\n' \ 42 | | sort -u \ 43 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 44 | )"; \ 45 | apk add --no-network --virtual .mediawiki-phpext-rundeps $runDeps; \ 46 | apk del --no-network .build-deps 47 | 48 | # set recommended PHP.ini settings 49 | # see https://secure.php.net/manual/en/opcache.installation.php 50 | RUN { \ 51 | echo 'opcache.memory_consumption=128'; \ 52 | echo 'opcache.interned_strings_buffer=8'; \ 53 | echo 'opcache.max_accelerated_files=4000'; \ 54 | echo 'opcache.revalidate_freq=60'; \ 55 | echo 'opcache.fast_shutdown=1'; \ 56 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 57 | 58 | # SQLite Directory Setup 59 | RUN set -eux; \ 60 | mkdir -p /var/www/data; \ 61 | chown -R www-data:www-data /var/www/data 62 | 63 | # Version 64 | ENV MEDIAWIKI_MAJOR_VERSION=1.45 65 | ENV MEDIAWIKI_VERSION=1.45.1 66 | 67 | # MediaWiki setup 68 | RUN set -eux; \ 69 | apk add --no-cache --virtual .fetch-deps \ 70 | bzip2 \ 71 | gnupg \ 72 | ; \ 73 | \ 74 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 75 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 76 | export GNUPGHOME="$(mktemp -d)"; \ 77 | # gpg key from https://www.mediawiki.org/keys/keys.txt 78 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 79 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 80 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 81 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 82 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 83 | E059C034E7A430583C252F4AA8F734246D73B586 \ 84 | ; \ 85 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 86 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 87 | gpgconf --kill all; \ 88 | rm -rf "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 89 | chown -R www-data:www-data extensions skins cache images; \ 90 | \ 91 | apk del --no-network .fetch-deps 92 | 93 | CMD ["php-fpm"] 94 | -------------------------------------------------------------------------------- /Dockerfile-alpine.template: -------------------------------------------------------------------------------- 1 | FROM php:%%PHP_VERSION%%-%%VARIANT%% 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apk add --no-cache \ 7 | git \ 8 | imagemagick \ 9 | # Required for SyntaxHighlighting 10 | python3 \ 11 | ; 12 | 13 | # Install the PHP extensions we need 14 | RUN set -eux; \ 15 | \ 16 | apk add --no-cache --virtual .build-deps \ 17 | $PHPIZE_DEPS \ 18 | icu-dev \ 19 | lua5.1-dev \ 20 | oniguruma-dev \ 21 | ; \ 22 | \ 23 | docker-php-ext-install -j "$(nproc)" \ 24 | calendar \ 25 | intl \ 26 | mbstring \ 27 | mysqli \ 28 | opcache \ 29 | ; \ 30 | \ 31 | pecl install APCu-%%APCU_VERSION%%; \ 32 | pecl install LuaSandbox-%%LUASANDBOX_VERSION%%; \ 33 | docker-php-ext-enable \ 34 | apcu \ 35 | luasandbox \ 36 | ; \ 37 | rm -r /tmp/pear; \ 38 | \ 39 | runDeps="$( \ 40 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 41 | | tr ',' '\n' \ 42 | | sort -u \ 43 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 44 | )"; \ 45 | apk add --no-network --virtual .mediawiki-phpext-rundeps $runDeps; \ 46 | apk del --no-network .build-deps 47 | 48 | # set recommended PHP.ini settings 49 | # see https://secure.php.net/manual/en/opcache.installation.php 50 | RUN { \ 51 | echo 'opcache.memory_consumption=128'; \ 52 | echo 'opcache.interned_strings_buffer=8'; \ 53 | echo 'opcache.max_accelerated_files=4000'; \ 54 | echo 'opcache.revalidate_freq=60'; \ 55 | echo 'opcache.fast_shutdown=1'; \ 56 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 57 | 58 | # SQLite Directory Setup 59 | RUN set -eux; \ 60 | mkdir -p /var/www/data; \ 61 | chown -R www-data:www-data /var/www/data 62 | 63 | # Version 64 | ENV MEDIAWIKI_MAJOR_VERSION=%%MEDIAWIKI_MAJOR_VERSION%% 65 | ENV MEDIAWIKI_VERSION=%%MEDIAWIKI_VERSION%% 66 | 67 | # MediaWiki setup 68 | RUN set -eux; \ 69 | apk add --no-cache --virtual .fetch-deps \ 70 | bzip2 \ 71 | gnupg \ 72 | ; \ 73 | \ 74 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 75 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 76 | export GNUPGHOME="$(mktemp -d)"; \ 77 | # gpg key from https://www.mediawiki.org/keys/keys.txt 78 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 79 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 80 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 81 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 82 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 83 | E059C034E7A430583C252F4AA8F734246D73B586 \ 84 | ; \ 85 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 86 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 87 | gpgconf --kill all; \ 88 | rm -rf "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 89 | chown -R www-data:www-data extensions skins cache images; \ 90 | \ 91 | apk del --no-network .fetch-deps 92 | 93 | CMD ["%%CMD%%"] 94 | -------------------------------------------------------------------------------- /1.39/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | 59 | # set recommended PHP.ini settings 60 | # see https://secure.php.net/manual/en/opcache.installation.php 61 | RUN { \ 62 | echo 'opcache.memory_consumption=128'; \ 63 | echo 'opcache.interned_strings_buffer=8'; \ 64 | echo 'opcache.max_accelerated_files=4000'; \ 65 | echo 'opcache.revalidate_freq=60'; \ 66 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 67 | 68 | # SQLite Directory Setup 69 | RUN set -eux; \ 70 | mkdir -p /var/www/data; \ 71 | chown -R www-data:www-data /var/www/data 72 | 73 | # Version 74 | ENV MEDIAWIKI_MAJOR_VERSION=1.39 75 | ENV MEDIAWIKI_VERSION=1.39.17 76 | 77 | # MediaWiki setup 78 | RUN set -eux; \ 79 | fetchDeps=" \ 80 | gnupg \ 81 | dirmngr \ 82 | "; \ 83 | apt-get update; \ 84 | apt-get install -y --no-install-recommends $fetchDeps; \ 85 | \ 86 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 87 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 88 | export GNUPGHOME="$(mktemp -d)"; \ 89 | # gpg key from https://www.mediawiki.org/keys/keys.txt 90 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 91 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 92 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 93 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 94 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 95 | E059C034E7A430583C252F4AA8F734246D73B586 \ 96 | ; \ 97 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 98 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 99 | gpgconf --kill all; \ 100 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 101 | chown -R www-data:www-data extensions skins cache images; \ 102 | \ 103 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 104 | rm -rf /var/lib/apt/lists/* 105 | 106 | CMD ["php-fpm"] 107 | -------------------------------------------------------------------------------- /1.43/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | 59 | # set recommended PHP.ini settings 60 | # see https://secure.php.net/manual/en/opcache.installation.php 61 | RUN { \ 62 | echo 'opcache.memory_consumption=128'; \ 63 | echo 'opcache.interned_strings_buffer=8'; \ 64 | echo 'opcache.max_accelerated_files=4000'; \ 65 | echo 'opcache.revalidate_freq=60'; \ 66 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 67 | 68 | # SQLite Directory Setup 69 | RUN set -eux; \ 70 | mkdir -p /var/www/data; \ 71 | chown -R www-data:www-data /var/www/data 72 | 73 | # Version 74 | ENV MEDIAWIKI_MAJOR_VERSION=1.43 75 | ENV MEDIAWIKI_VERSION=1.43.6 76 | 77 | # MediaWiki setup 78 | RUN set -eux; \ 79 | fetchDeps=" \ 80 | gnupg \ 81 | dirmngr \ 82 | "; \ 83 | apt-get update; \ 84 | apt-get install -y --no-install-recommends $fetchDeps; \ 85 | \ 86 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 87 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 88 | export GNUPGHOME="$(mktemp -d)"; \ 89 | # gpg key from https://www.mediawiki.org/keys/keys.txt 90 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 91 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 92 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 93 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 94 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 95 | E059C034E7A430583C252F4AA8F734246D73B586 \ 96 | ; \ 97 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 98 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 99 | gpgconf --kill all; \ 100 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 101 | chown -R www-data:www-data extensions skins cache images; \ 102 | \ 103 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 104 | rm -rf /var/lib/apt/lists/* 105 | 106 | CMD ["php-fpm"] 107 | -------------------------------------------------------------------------------- /1.44/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | 59 | # set recommended PHP.ini settings 60 | # see https://secure.php.net/manual/en/opcache.installation.php 61 | RUN { \ 62 | echo 'opcache.memory_consumption=128'; \ 63 | echo 'opcache.interned_strings_buffer=8'; \ 64 | echo 'opcache.max_accelerated_files=4000'; \ 65 | echo 'opcache.revalidate_freq=60'; \ 66 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 67 | 68 | # SQLite Directory Setup 69 | RUN set -eux; \ 70 | mkdir -p /var/www/data; \ 71 | chown -R www-data:www-data /var/www/data 72 | 73 | # Version 74 | ENV MEDIAWIKI_MAJOR_VERSION=1.44 75 | ENV MEDIAWIKI_VERSION=1.44.3 76 | 77 | # MediaWiki setup 78 | RUN set -eux; \ 79 | fetchDeps=" \ 80 | gnupg \ 81 | dirmngr \ 82 | "; \ 83 | apt-get update; \ 84 | apt-get install -y --no-install-recommends $fetchDeps; \ 85 | \ 86 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 87 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 88 | export GNUPGHOME="$(mktemp -d)"; \ 89 | # gpg key from https://www.mediawiki.org/keys/keys.txt 90 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 91 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 92 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 93 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 94 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 95 | E059C034E7A430583C252F4AA8F734246D73B586 \ 96 | ; \ 97 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 98 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 99 | gpgconf --kill all; \ 100 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 101 | chown -R www-data:www-data extensions skins cache images; \ 102 | \ 103 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 104 | rm -rf /var/lib/apt/lists/* 105 | 106 | CMD ["php-fpm"] 107 | -------------------------------------------------------------------------------- /1.45/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | 59 | # set recommended PHP.ini settings 60 | # see https://secure.php.net/manual/en/opcache.installation.php 61 | RUN { \ 62 | echo 'opcache.memory_consumption=128'; \ 63 | echo 'opcache.interned_strings_buffer=8'; \ 64 | echo 'opcache.max_accelerated_files=4000'; \ 65 | echo 'opcache.revalidate_freq=60'; \ 66 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 67 | 68 | # SQLite Directory Setup 69 | RUN set -eux; \ 70 | mkdir -p /var/www/data; \ 71 | chown -R www-data:www-data /var/www/data 72 | 73 | # Version 74 | ENV MEDIAWIKI_MAJOR_VERSION=1.45 75 | ENV MEDIAWIKI_VERSION=1.45.1 76 | 77 | # MediaWiki setup 78 | RUN set -eux; \ 79 | fetchDeps=" \ 80 | gnupg \ 81 | dirmngr \ 82 | "; \ 83 | apt-get update; \ 84 | apt-get install -y --no-install-recommends $fetchDeps; \ 85 | \ 86 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 87 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 88 | export GNUPGHOME="$(mktemp -d)"; \ 89 | # gpg key from https://www.mediawiki.org/keys/keys.txt 90 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 91 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 92 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 93 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 94 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 95 | E059C034E7A430583C252F4AA8F734246D73B586 \ 96 | ; \ 97 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 98 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 99 | gpgconf --kill all; \ 100 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 101 | chown -R www-data:www-data extensions skins cache images; \ 102 | \ 103 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 104 | rm -rf /var/lib/apt/lists/* 105 | 106 | CMD ["php-fpm"] 107 | -------------------------------------------------------------------------------- /Dockerfile-debian.template: -------------------------------------------------------------------------------- 1 | FROM php:%%PHP_VERSION%%-%%VARIANT%% 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-%%APCU_VERSION%%; \ 37 | pecl install LuaSandbox-%%LUASANDBOX_VERSION%%; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | %%VARIANT_EXTRAS%% 58 | 59 | # set recommended PHP.ini settings 60 | # see https://secure.php.net/manual/en/opcache.installation.php 61 | RUN { \ 62 | echo 'opcache.memory_consumption=128'; \ 63 | echo 'opcache.interned_strings_buffer=8'; \ 64 | echo 'opcache.max_accelerated_files=4000'; \ 65 | echo 'opcache.revalidate_freq=60'; \ 66 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 67 | 68 | # SQLite Directory Setup 69 | RUN set -eux; \ 70 | mkdir -p /var/www/data; \ 71 | chown -R www-data:www-data /var/www/data 72 | 73 | # Version 74 | ENV MEDIAWIKI_MAJOR_VERSION=%%MEDIAWIKI_MAJOR_VERSION%% 75 | ENV MEDIAWIKI_VERSION=%%MEDIAWIKI_VERSION%% 76 | 77 | # MediaWiki setup 78 | RUN set -eux; \ 79 | fetchDeps=" \ 80 | gnupg \ 81 | dirmngr \ 82 | "; \ 83 | apt-get update; \ 84 | apt-get install -y --no-install-recommends $fetchDeps; \ 85 | \ 86 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 87 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 88 | export GNUPGHOME="$(mktemp -d)"; \ 89 | # gpg key from https://www.mediawiki.org/keys/keys.txt 90 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 91 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 92 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 93 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 94 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 95 | E059C034E7A430583C252F4AA8F734246D73B586 \ 96 | ; \ 97 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 98 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 99 | gpgconf --kill all; \ 100 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 101 | chown -R www-data:www-data extensions skins cache images; \ 102 | \ 103 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 104 | rm -rf /var/lib/apt/lists/* 105 | 106 | CMD ["%%CMD%%"] 107 | -------------------------------------------------------------------------------- /1.39/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-apache 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | # Enable Short URLs 59 | RUN set -eux; \ 60 | a2enmod rewrite; \ 61 | { \ 62 | echo ""; \ 63 | echo " RewriteEngine On"; \ 64 | echo " RewriteCond %{REQUEST_FILENAME} !-f"; \ 65 | echo " RewriteCond %{REQUEST_FILENAME} !-d"; \ 66 | echo " RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \ 67 | echo ""; \ 68 | } > "$APACHE_CONFDIR/conf-available/short-url.conf"; \ 69 | a2enconf short-url 70 | 71 | # Enable AllowEncodedSlashes for VisualEditor 72 | RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf" 73 | 74 | # set recommended PHP.ini settings 75 | # see https://secure.php.net/manual/en/opcache.installation.php 76 | RUN { \ 77 | echo 'opcache.memory_consumption=128'; \ 78 | echo 'opcache.interned_strings_buffer=8'; \ 79 | echo 'opcache.max_accelerated_files=4000'; \ 80 | echo 'opcache.revalidate_freq=60'; \ 81 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 82 | 83 | # SQLite Directory Setup 84 | RUN set -eux; \ 85 | mkdir -p /var/www/data; \ 86 | chown -R www-data:www-data /var/www/data 87 | 88 | # Version 89 | ENV MEDIAWIKI_MAJOR_VERSION=1.39 90 | ENV MEDIAWIKI_VERSION=1.39.17 91 | 92 | # MediaWiki setup 93 | RUN set -eux; \ 94 | fetchDeps=" \ 95 | gnupg \ 96 | dirmngr \ 97 | "; \ 98 | apt-get update; \ 99 | apt-get install -y --no-install-recommends $fetchDeps; \ 100 | \ 101 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 102 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 103 | export GNUPGHOME="$(mktemp -d)"; \ 104 | # gpg key from https://www.mediawiki.org/keys/keys.txt 105 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 106 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 107 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 108 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 109 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 110 | E059C034E7A430583C252F4AA8F734246D73B586 \ 111 | ; \ 112 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 113 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 114 | gpgconf --kill all; \ 115 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 116 | chown -R www-data:www-data extensions skins cache images; \ 117 | \ 118 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 119 | rm -rf /var/lib/apt/lists/* 120 | 121 | CMD ["apache2-foreground"] 122 | -------------------------------------------------------------------------------- /1.43/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-apache 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | # Enable Short URLs 59 | RUN set -eux; \ 60 | a2enmod rewrite; \ 61 | { \ 62 | echo ""; \ 63 | echo " RewriteEngine On"; \ 64 | echo " RewriteCond %{REQUEST_FILENAME} !-f"; \ 65 | echo " RewriteCond %{REQUEST_FILENAME} !-d"; \ 66 | echo " RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \ 67 | echo ""; \ 68 | } > "$APACHE_CONFDIR/conf-available/short-url.conf"; \ 69 | a2enconf short-url 70 | 71 | # Enable AllowEncodedSlashes for VisualEditor 72 | RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf" 73 | 74 | # set recommended PHP.ini settings 75 | # see https://secure.php.net/manual/en/opcache.installation.php 76 | RUN { \ 77 | echo 'opcache.memory_consumption=128'; \ 78 | echo 'opcache.interned_strings_buffer=8'; \ 79 | echo 'opcache.max_accelerated_files=4000'; \ 80 | echo 'opcache.revalidate_freq=60'; \ 81 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 82 | 83 | # SQLite Directory Setup 84 | RUN set -eux; \ 85 | mkdir -p /var/www/data; \ 86 | chown -R www-data:www-data /var/www/data 87 | 88 | # Version 89 | ENV MEDIAWIKI_MAJOR_VERSION=1.43 90 | ENV MEDIAWIKI_VERSION=1.43.6 91 | 92 | # MediaWiki setup 93 | RUN set -eux; \ 94 | fetchDeps=" \ 95 | gnupg \ 96 | dirmngr \ 97 | "; \ 98 | apt-get update; \ 99 | apt-get install -y --no-install-recommends $fetchDeps; \ 100 | \ 101 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 102 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 103 | export GNUPGHOME="$(mktemp -d)"; \ 104 | # gpg key from https://www.mediawiki.org/keys/keys.txt 105 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 106 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 107 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 108 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 109 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 110 | E059C034E7A430583C252F4AA8F734246D73B586 \ 111 | ; \ 112 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 113 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 114 | gpgconf --kill all; \ 115 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 116 | chown -R www-data:www-data extensions skins cache images; \ 117 | \ 118 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 119 | rm -rf /var/lib/apt/lists/* 120 | 121 | CMD ["apache2-foreground"] 122 | -------------------------------------------------------------------------------- /1.44/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-apache 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | # Enable Short URLs 59 | RUN set -eux; \ 60 | a2enmod rewrite; \ 61 | { \ 62 | echo ""; \ 63 | echo " RewriteEngine On"; \ 64 | echo " RewriteCond %{REQUEST_FILENAME} !-f"; \ 65 | echo " RewriteCond %{REQUEST_FILENAME} !-d"; \ 66 | echo " RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \ 67 | echo ""; \ 68 | } > "$APACHE_CONFDIR/conf-available/short-url.conf"; \ 69 | a2enconf short-url 70 | 71 | # Enable AllowEncodedSlashes for VisualEditor 72 | RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf" 73 | 74 | # set recommended PHP.ini settings 75 | # see https://secure.php.net/manual/en/opcache.installation.php 76 | RUN { \ 77 | echo 'opcache.memory_consumption=128'; \ 78 | echo 'opcache.interned_strings_buffer=8'; \ 79 | echo 'opcache.max_accelerated_files=4000'; \ 80 | echo 'opcache.revalidate_freq=60'; \ 81 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 82 | 83 | # SQLite Directory Setup 84 | RUN set -eux; \ 85 | mkdir -p /var/www/data; \ 86 | chown -R www-data:www-data /var/www/data 87 | 88 | # Version 89 | ENV MEDIAWIKI_MAJOR_VERSION=1.44 90 | ENV MEDIAWIKI_VERSION=1.44.3 91 | 92 | # MediaWiki setup 93 | RUN set -eux; \ 94 | fetchDeps=" \ 95 | gnupg \ 96 | dirmngr \ 97 | "; \ 98 | apt-get update; \ 99 | apt-get install -y --no-install-recommends $fetchDeps; \ 100 | \ 101 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 102 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 103 | export GNUPGHOME="$(mktemp -d)"; \ 104 | # gpg key from https://www.mediawiki.org/keys/keys.txt 105 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 106 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 107 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 108 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 109 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 110 | E059C034E7A430583C252F4AA8F734246D73B586 \ 111 | ; \ 112 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 113 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 114 | gpgconf --kill all; \ 115 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 116 | chown -R www-data:www-data extensions skins cache images; \ 117 | \ 118 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 119 | rm -rf /var/lib/apt/lists/* 120 | 121 | CMD ["apache2-foreground"] 122 | -------------------------------------------------------------------------------- /1.45/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-apache 2 | 3 | # System dependencies 4 | RUN set -eux; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | git \ 9 | librsvg2-bin \ 10 | imagemagick \ 11 | # Required for SyntaxHighlighting 12 | python3 \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | # Install the PHP extensions we need 17 | RUN set -eux; \ 18 | \ 19 | savedAptMark="$(apt-mark showmanual)"; \ 20 | \ 21 | apt-get update; \ 22 | apt-get install -y --no-install-recommends \ 23 | libicu-dev \ 24 | libonig-dev \ 25 | liblua5.1-0-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-install -j "$(nproc)" \ 29 | calendar \ 30 | intl \ 31 | mbstring \ 32 | mysqli \ 33 | opcache \ 34 | ; \ 35 | \ 36 | pecl install APCu-5.1.28; \ 37 | pecl install LuaSandbox-4.1.2; \ 38 | docker-php-ext-enable \ 39 | apcu \ 40 | luasandbox \ 41 | ; \ 42 | rm -r /tmp/pear; \ 43 | \ 44 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 45 | apt-mark auto '.*' > /dev/null; \ 46 | apt-mark manual $savedAptMark; \ 47 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 48 | | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ 49 | | sort -u \ 50 | | xargs -r dpkg-query --search \ 51 | | cut -d: -f1 \ 52 | | sort -u \ 53 | | xargs -rt apt-mark manual; \ 54 | \ 55 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | # Enable Short URLs 59 | RUN set -eux; \ 60 | a2enmod rewrite; \ 61 | { \ 62 | echo ""; \ 63 | echo " RewriteEngine On"; \ 64 | echo " RewriteCond %{REQUEST_FILENAME} !-f"; \ 65 | echo " RewriteCond %{REQUEST_FILENAME} !-d"; \ 66 | echo " RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \ 67 | echo ""; \ 68 | } > "$APACHE_CONFDIR/conf-available/short-url.conf"; \ 69 | a2enconf short-url 70 | 71 | # Enable AllowEncodedSlashes for VisualEditor 72 | RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf" 73 | 74 | # set recommended PHP.ini settings 75 | # see https://secure.php.net/manual/en/opcache.installation.php 76 | RUN { \ 77 | echo 'opcache.memory_consumption=128'; \ 78 | echo 'opcache.interned_strings_buffer=8'; \ 79 | echo 'opcache.max_accelerated_files=4000'; \ 80 | echo 'opcache.revalidate_freq=60'; \ 81 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 82 | 83 | # SQLite Directory Setup 84 | RUN set -eux; \ 85 | mkdir -p /var/www/data; \ 86 | chown -R www-data:www-data /var/www/data 87 | 88 | # Version 89 | ENV MEDIAWIKI_MAJOR_VERSION=1.45 90 | ENV MEDIAWIKI_VERSION=1.45.1 91 | 92 | # MediaWiki setup 93 | RUN set -eux; \ 94 | fetchDeps=" \ 95 | gnupg \ 96 | dirmngr \ 97 | "; \ 98 | apt-get update; \ 99 | apt-get install -y --no-install-recommends $fetchDeps; \ 100 | \ 101 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \ 102 | curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \ 103 | export GNUPGHOME="$(mktemp -d)"; \ 104 | # gpg key from https://www.mediawiki.org/keys/keys.txt 105 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \ 106 | D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \ 107 | 441276E9CCD15F44F6D97D18C119E1A64D70938E \ 108 | F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \ 109 | 1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \ 110 | E059C034E7A430583C252F4AA8F734246D73B586 \ 111 | ; \ 112 | gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \ 113 | tar -x --strip-components=1 -f mediawiki.tar.gz; \ 114 | gpgconf --kill all; \ 115 | rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \ 116 | chown -R www-data:www-data extensions skins cache images; \ 117 | \ 118 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 119 | rm -rf /var/lib/apt/lists/* 120 | 121 | CMD ["apache2-foreground"] 122 | -------------------------------------------------------------------------------- /update.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | import argparse 5 | import functools 6 | import subprocess 7 | from pathlib import Path 8 | 9 | PHP_VERSIONS = { 10 | "default": "8.3", 11 | } 12 | APCU_VERSION = "5.1.28" 13 | LUASANDBOX_VERSION = "4.1.2" 14 | VARIANTS = ["apache", "fpm", "fpm-alpine"] 15 | ROOT_DIR = Path(__file__).parent 16 | 17 | APACHE_EXTRA = r""" 18 | # Enable Short URLs 19 | RUN set -eux; \ 20 | a2enmod rewrite; \ 21 | { \ 22 | echo ""; \ 23 | echo " RewriteEngine On"; \ 24 | echo " RewriteCond %{REQUEST_FILENAME} !-f"; \ 25 | echo " RewriteCond %{REQUEST_FILENAME} !-d"; \ 26 | echo " RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \ 27 | echo ""; \ 28 | } > "$APACHE_CONFDIR/conf-available/short-url.conf"; \ 29 | a2enconf short-url 30 | 31 | # Enable AllowEncodedSlashes for VisualEditor 32 | RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf" 33 | """.rstrip().replace( 34 | " ", "\t" 35 | ) 36 | 37 | 38 | @functools.lru_cache() 39 | def fetch_tags() -> list[str]: 40 | output = subprocess.check_output( 41 | [ 42 | "git", 43 | "ls-remote", 44 | "--sort=version:refname", 45 | "--tags", 46 | "https://github.com/wikimedia/mediawiki.git", 47 | ], 48 | text=True, 49 | ) 50 | tags = [] 51 | for line in output.splitlines(): 52 | ref = line.split("\t", 1)[1] 53 | if not ref.endswith("^{}"): 54 | continue 55 | # strip refs/tags prefix and ^{} suffix 56 | tags.append(ref[10:][:-3]) 57 | tags.reverse() 58 | return tags 59 | 60 | 61 | def latest_version(version: str) -> str: 62 | for tag in fetch_tags(): 63 | if tag.startswith(f"{version}."): 64 | return tag 65 | raise RuntimeError(f"couldn't find release for {version}") 66 | 67 | 68 | def main(): 69 | parser = argparse.ArgumentParser(description="Update Dockerfiles") 70 | parser.add_argument( 71 | "--commit", help="Create Git commit if there are changes", action="store_true" 72 | ) 73 | parser.add_argument( 74 | "--pr", help="Open a pull request with the changes", action="store_true" 75 | ) 76 | args = parser.parse_args() 77 | 78 | updates = set() 79 | for folder in ROOT_DIR.glob("1.*/"): 80 | branch = folder.name 81 | latest = latest_version(branch) 82 | for variant in VARIANTS: 83 | vdir = folder / variant 84 | vdir.mkdir(exist_ok=True) 85 | base = "alpine" if variant.endswith("-alpine") else "debian" 86 | template = (ROOT_DIR / f"Dockerfile-{base}.template").read_text() 87 | new = ( 88 | template.replace( 89 | "%%PHP_VERSION%%", PHP_VERSIONS.get(branch, PHP_VERSIONS["default"]) 90 | ) 91 | .replace("%%MEDIAWIKI_MAJOR_VERSION%%", branch) 92 | .replace("%%MEDIAWIKI_VERSION%%", latest) 93 | .replace("%%VARIANT%%", variant) 94 | .replace("%%APCU_VERSION%%", APCU_VERSION) 95 | .replace("%%LUASANDBOX_VERSION%%", LUASANDBOX_VERSION) 96 | .replace( 97 | "%%CMD%%", 98 | "apache2-foreground" if variant == "apache" else "php-fpm", 99 | ) 100 | .replace( 101 | "%%VARIANT_EXTRAS%%", APACHE_EXTRA if variant == "apache" else "" 102 | ) 103 | ) 104 | dockerfile = vdir / "Dockerfile" 105 | if dockerfile.read_text() != new: 106 | dockerfile.write_text(new) 107 | print(f"Updated {branch}/{variant}") 108 | updates.add(latest) 109 | if not updates: 110 | print("No changes") 111 | return 112 | if not args.commit: 113 | return 114 | 115 | message = "Update to " + " / ".join(sorted(updates, reverse=True)) 116 | subprocess.check_call(["git", "commit", "-a", "-m", message]) 117 | 118 | if not args.pr: 119 | return 120 | git_branch = subprocess.check_output( 121 | ["git", "branch", "--show-current"], text=True 122 | ).strip() 123 | subprocess.check_call(["git", "push", "-f", "origin", git_branch]) 124 | subprocess.check_call(["gh", "pr", "create", "--fill"]) 125 | 126 | 127 | if __name__ == "__main__": 128 | main() 129 | --------------------------------------------------------------------------------