forked from wikimedia/mediawiki-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-alpine.template
89 lines (82 loc) · 2.42 KB
/
Dockerfile-alpine.template
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
FROM php:%%PHP_VERSION%%-%%VARIANT%%
# System dependencies
RUN set -eux; \
\
apk add --no-cache \
git \
imagemagick \
# Required for SyntaxHighlighting
python3 \
;
# Install the PHP extensions we need
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
icu-dev \
oniguruma-dev \
; \
\
docker-php-ext-install -j "$(nproc)" \
calendar \
intl \
mbstring \
mysqli \
opcache \
; \
\
pecl install APCu-%%APCU_VERSION%%; \
docker-php-ext-enable \
apcu \
; \
rm -r /tmp/pear; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .mediawiki-phpext-rundeps $runDeps; \
apk del .build-deps
# 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 %%MEDIAWIKI_MAJOR_VERSION%%
ENV MEDIAWIKI_VERSION %%MEDIAWIKI_VERSION%%
# MediaWiki setup
RUN set -eux; \
apk add --no-cache --virtual .fetch-deps \
bzip2 \
gnupg \
; \
\
curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \
curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \
export GNUPGHOME="$(mktemp -d)"; \
# gpg key from https://www.mediawiki.org/keys/keys.txt
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \
D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \
441276E9CCD15F44F6D97D18C119E1A64D70938E \
F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \
1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \
; \
gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \
tar -x --strip-components=1 -f mediawiki.tar.gz; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \
chown -R www-data:www-data extensions skins cache images; \
\
apk del .fetch-deps
CMD ["%%CMD%%"]