Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
Woraround for T232866
Browse files Browse the repository at this point in the history
More find grained approach for building MediaWiki
  • Loading branch information
physikerwelt committed Sep 15, 2019
1 parent 700f965 commit b2f700e
Show file tree
Hide file tree
Showing 7 changed files with 579 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@
[submodule "mediawiki/extensions/Wikibase"]
path = mediawiki/extensions/Wikibase
url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase.git
[submodule "core"]
path = core
url = https://gerrit.wikimedia.org/r/mediawiki/core
[submodule "mathoid"]
path = mathoid
url = https://gerrit.wikimedia.org/r/mediawiki/services/mathoid
96 changes: 90 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,100 @@
FROM mediawiki:1.33 AS base

FROM composer:1.5.1 AS composer
WORKDIR /composer
COPY --from=base /var/www/html /composer
COPY /core /composer
COPY ./composer /composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN ["composer","install","--no-dev"]
RUN ["composer","install","--no-dev"]
RUN ["composer","update","--no-dev"]


FROM mediawiki:1.33
FROM php:7.2-apache

# System dependencies
RUN set -eux; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
git \
librsvg2-bin \
imagemagick \
# Required for SyntaxHighlighting
python3 \
# temporary woraround for T232866
curl \
gnupg \
; \
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 \
; \
\
docker-php-ext-install -j "$(nproc)" \
intl \
mbstring \
mysqli \
opcache \
; \
\
pecl install apcu-5.1.17; \
docker-php-ext-enable \
apcu \
; \
\
# 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 '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| 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/*

# Enable Short URLs
RUN set -eux; \
a2enmod rewrite; \
{ \
echo '<Directory /var/www/html>'; \
echo ' RewriteEngine On'; \
echo ' RewriteCond %{REQUEST_FILENAME} !-f'; \
echo ' RewriteCond %{REQUEST_FILENAME} !-d'; \
echo ' RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]'; \
echo '</Directory>'; \
} > "$APACHE_CONFDIR/conf-available/short-url.conf"; \
a2enconf short-url

# 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'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# SQLite Directory Setup
RUN set -eux; \
mkdir -p /var/www/data; \
chown -R www-data:www-data /var/www/data

COPY --from=composer /composer /var/www/html
COPY /mediawiki /var/www/html
RUN chown -R www-data:www-data /var/www/html/images
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get -y install nodejs librsvg2-dev
WORKDIR /srv/
RUN git clone "https://gerrit.wikimedia.org/r/mediawiki/services/mathoid"
WORKDIR /srv/mathoid
RUN npm i
WORKDIR /var/www/html
Loading

0 comments on commit b2f700e

Please sign in to comment.