This repository was archived by the owner on Jul 28, 2025. It is now read-only.
forked from wikimedia/mediawiki-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
108 lines (99 loc) · 2.99 KB
/
Dockerfile
File metadata and controls
108 lines (99 loc) · 2.99 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
FROM php:7.3-apache
ENV MEDIAWIKI_DB_NAME=mediawiki
ENV MEDIAWIKI_DB_SCHEMA=mediawiki
ENV MEDIAWIKI_DB_PORT=""
ENV MEDIAWIKI_DB_HOST=localhost
ENV MEDIAWIKI_DB_TYPE=sqlite
ENV MEDIAWIKI_DB_USER=mediawiki
ENV MEDIAWIKI_DB_PASSWORD=mediawiki
ENV MEDIAWIKI_SITE_SERVER=http://localhost:8080
ENV MEDIAWIKI_SITE_LANG=en
ENV MEDIAWIKI_ADMIN_USER=admin
ENV MEDIAWIKI_ADMIN_PASS=adminpassword
ENV MEDIAWIKI_SITE_NAME=MediaWiki
# System dependencies
RUN set -eux; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
git \
librsvg2-bin \
imagemagick \
# Required for SyntaxHighlighting
python3 \
; \
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.18; \
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
# Version
ENV MEDIAWIKI_MAJOR_VERSION 1.34
ENV MEDIAWIKI_BRANCH REL1_34
ENV MEDIAWIKI_VERSION 1.34.0
ENV MEDIAWIKI_SHA512 b6b1aeec26a1c114eeec0bdf18d4b3160fe02dac2920a39a045acb74e62aa8f8a28e6a81c01fedba7976e4dd0c96463e0f1badfddd3015eef9197b01586a236d
# MediaWiki setup
RUN set -eux; \
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 -x --strip-components=1 -f mediawiki.tar.gz; \
rm mediawiki.tar.gz; \
chown -R www-data:www-data extensions skins cache images
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]