FROM mediawiki:1.34.0

ENV GIT_URL https://gerrit.wikimedia.org/r/mediawiki
ENV MW_DIR /var/www/html

RUN cd "$MW_DIR/extensions" \
    && git clone $GIT_URL/extensions/LDAPProvider \
    && git clone $GIT_URL/extensions/PluggableAuth \
    && git clone $GIT_URL/extensions/LDAPAuthentication2 \
    && git clone -b REL1_34 $GIT_URL/extensions/VisualEditor \
    && (cd VisualEditor && git submodule update --init) \
    && git clone $GIT_URL/extensions/MobileFrontend \
    && chown www-data:www-data -R * \
    && cd "$MW_DIR/skins" \
    && git clone $GIT_URL/skins/MinervaNeue \
    && chown www-data:www-data -R MinervaNeue

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        libldap-dev \
    && rm -rf /var/lib/apt/lists/* \
    && docker-php-ext-install ldap
