Skip to content

Instantly share code, notes, and snippets.

@vid
Created April 4, 2024 14:20
Show Gist options
  • Save vid/498268a053de1a52b8dd713f7e8ba81f to your computer and use it in GitHub Desktop.
Save vid/498268a053de1a52b8dd713f7e8ba81f to your computer and use it in GitHub Desktop.
Dockerfile mw 1.39 w smw and some interim cruft
FROM mediawiki:1.39.6 AS build
ENV MEDIAWIKI_EXT_BRANCH REL1_39
RUN set -x; \
apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
git \
libzip-dev \
unzip \
zlib1g-dev \
&& docker-php-ext-install \
calendar \
zip \
&& rm -rf /var/lib/apt/lists/*
RUN set -x; \
apt-get update \
&& apt-get install -y --no-install-recommends \
vim \
libonig-dev \
&& docker-php-ext-install \
mbstring \
&& rm -rf /var/lib/apt/lists/* \
&& chown -R 1000 /var/www/html/vendor \
&& chown -R 1000 /var/www/html/extensions \
&& chown -R 1000 /var/www/html/skins
COPY --from=composer:2.1 /usr/bin/composer /usr/bin/composer
USER 1000
ENV COMPOSER_HOME=/tmp
# Install composer based extensions
RUN cd /var/www/html/ \
&& composer config platform.php 8.0 \
&& composer require --update-no-dev \
"mediawiki/semantic-media-wiki ~4.1.2" \
"mediawiki/semantic-result-formats ~4.2.0" \
"mediawiki/semantic-compound-queries ~2.2" \
"mwstake/mediawiki-component-manifestregistry:~2.0" \
"mediawiki/maps:~10.1"
# Install extensions with a git based install
RUN git clone --depth=1 -b $MEDIAWIKI_EXT_BRANCH https://gerrit.wikimedia.org/r/mediawiki/extensions/ExternalData.git /var/www/html/extensions/ExternalData
RUN git clone --depth=1 -b $MEDIAWIKI_EXT_BRANCH https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms.git /var/www/html/extensions/PageForms
RUN git clone --depth=1 -b $MEDIAWIKI_EXT_BRANCH https://gerrit.wikimedia.org/r/mediawiki/extensions/Arrays.git /var/www/html/extensions/Arrays
RUN git clone --depth=1 -b $MEDIAWIKI_EXT_BRANCH https://gerrit.wikimedia.org/r/mediawiki/extensions/HeaderTabs.git /var/www/html/extensions/HeaderTabs
RUN git clone --depth=1 -b $MEDIAWIKI_EXT_BRANCH https://gerrit.wikimedia.org/r/mediawiki/extensions/Variables.git /var/www/html/extensions/Variables
RUN git clone --depth=1 -b $MEDIAWIKI_EXT_BRANCH https://gerrit.wikimedia.org/r/mediawiki/extensions/HeadScript /var/www/html/extensions/HeadScript
# DKL-LI-0003: remove unnecessary files
RUN rm -rf \
/var/www/html/extensions/*/.git \
/var/www/html/skins/*/.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment