-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
91 lines (78 loc) · 3.87 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
FROM php:7.2-apache
WORKDIR /var/www/html/w
# System Dependencies.
RUN apt-get update && apt-get install -y \
git \
imagemagick \
libicu-dev \
# Required for SyntaxHighlighting
python3 \
# Extensions
unzip \
--no-install-recommends && rm -r /var/lib/apt/lists/*
# Install the PHP extensions we need
RUN docker-php-ext-install mbstring mysqli opcache intl
# Install the default object cache.
RUN pecl channel-update pecl.php.net \
&& pecl install apcu \
&& docker-php-ext-enable apcu
# 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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
## enable file uploads
RUN echo 'file_uploads = On' > /usr/local/etc/php/conf.d/docker-php-uploads.ini
# SQLite Directory Setup
RUN mkdir -p /var/www/data \
&& chown -R www-data:www-data /var/www/data
# Version
ENV MEDIAWIKI_MAJOR_VERSION 1.31
ENV MEDIAWIKI_BRANCH REL1_31
ENV MEDIAWIKI_VERSION 1.31.1
ENV MEDIAWIKI_SHA512 ee49649cc37d0a7d45a7c6d90c822c2a595df290be2b5bf085affbec3318768700a458a6e5b5b7e437651400b9641424429d6d304f870c22ec63fae86ffc5152
# MediaWiki setup
RUN curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz \
&& echo "${MEDIAWIKI_SHA512} *mediawiki.tar.gz" | sha512sum -c - \
&& tar -xz --strip-components=1 -f mediawiki.tar.gz \
&& rm mediawiki.tar.gz \
&& curl https://getcomposer.org/download/1.10.7/composer.phar -o composer.phar
# Manually install extensions & skins
RUN curl -fSL 'https://extdist.wmflabs.org/dist/extensions/AbuseFilter-REL1_31-7b66a2c.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/AntiSpoof-REL1_31-48ed1f8.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/Capiunto-REL1_31-cbcd67b.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/GeoData-REL1_31-96cda6b.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/MobileFrontend-REL1_31-db6d3d1.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/OpenIDConnect-REL1_31-baea47f.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_31-300ac44.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/Scribunto-REL1_31-106fbf4.tar.gz' | tar -xz -C ./extensions \
&& curl -fSL 'https://extdist.wmflabs.org/dist/extensions/UserMerge-REL1_31-86f0e02.tar.gz' | tar -xz -C ./extensions \
# Skins
&& curl -fSL 'https://extdist.wmflabs.org/dist/skins/MinervaNeue-REL1_31-2e70e79.tar.gz' | tar -xz -C ./skins
# Built-in Extensions
RUN { \
echo '{'; \
echo ' "require": {'; \
echo ' "mediawiki/maps": "^7",'; \
echo ' "pear/mail": "1.4.1",'; \
echo ' "pear/net_smtp": "1.8.0"'; \
echo ' },'; \
echo ' "extra": {'; \
echo ' "merge-plugin": {'; \
echo ' "include": ['; \
echo ' "extensions/OpenIDConnect/composer.json"'; \
echo ' ]'; \
echo ' }'; \
echo ' }'; \
echo '}'; \
} > /var/www/html/w/composer.local.json
# Install built-in extensions + extension dependencies
RUN php composer.phar update --no-dev \
&& php composer.phar install -d ./extensions/AbuseFilter
# Permissions
RUN chown -R www-data:www-data cache extensions images skins