This repository has been archived by the owner on Jun 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More find grained approach for building MediaWiki
- Loading branch information
1 parent
700f965
commit b2f700e
Showing
7 changed files
with
579 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.