forked from wikimedia/mediawiki-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
106 lines (91 loc) · 4.31 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM debian:sid
MAINTAINER Gabriel Wicke <gwicke@wikimedia.org>
# XXX: Consider switching to nginx.
RUN set -x; \
apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
apache2 \
libapache2-mod-php5 \
php5-mysql \
php5-cli \
php5-gd \
php5-curl \
imagemagick \
netcat \
git \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/archives/* \
&& a2enmod rewrite \
&& a2enmod proxy \
&& a2enmod proxy_http \
# Remove the default Debian index page.
&& rm /var/www/html/index.html
# Install mailsystem
ENV DEBIAN_FRONTEND noninteractive
RUN set -x; \
mkdir -p /etc/nullmailer \
&& echo "base.transformap.co" > /etc/mailname \
&& touch /etc/nullmailer/defaultdomain \
&& echo "mapping@transformap.co" > /etc/nullmailer/adminaddr \
&& echo "mail.ecobytes.net smtp" > /etc/nullmailer/remotes \
&& chown mail:mail /etc/nullmailer/remotes \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nullmailer \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/archives/*
# Waiting in antiticipation for built-time arguments
# https://github.com/docker/docker/issues/14634
ENV MEDIAWIKI_VERSION REL1_27
# MediaWiki setup
RUN set -x; \
mkdir -p /usr/src \
&& git clone \
--depth 1 \
-b $MEDIAWIKI_VERSION \
https://gerrit.wikimedia.org/r/p/mediawiki/core.git \
/usr/src/mediawiki
WORKDIR /usr/src/mediawiki
RUN git clone --depth 1 https://gerrit.wikimedia.org/r/p/mediawiki/vendor.git
WORKDIR /usr/src/mediawiki/vendor
RUN git submodule update --init --recursive \
&& git submodule foreach 'git checkout $(MEDIAWIKI_VERSION) || :'
#WORKDIR /usr/src/mediawiki/extensions
#RUN if [ -d "/usr/src/mediawiki/extensions" -a $(ls /usr/src/mediawiki/extensions) = "README" ]; then \
# echo "extensions exists, removing" && rm -rf /usr/src/mediawiki/extensions/ && mkdir -p /usr/src/mediawiki/extensions/; fi
#RUN git clone --depth 1 https://gerrit.wikimedia.org/r/p/mediawiki/extensions.git
#RUN git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Wikibase.git \
# && git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UniversalLanguageSelector.git \
# && git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Babel.git \
# && git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/cldr.git \
# && git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/CategoryTree.git
#RUN for i in Wikibase UniversalLanguageSelector Babel cldr CategoryTree; do cd $i; git checkout -b $(MEDIAWIKI_VERSION) origin/$(MEDIAWIKI_VERSION); cd ..; done
#RUN git submodule update --init --recursive \
# && git submodule foreach 'git checkout $(MEDIAWIKI_VERSION) || :'
WORKDIR /usr/src/mediawiki
#RUN if [ -d "/usr/src/mediawiki/skins" -a $(ls /usr/src/mediawiki/skins) = "README" ]; then \
RUN if [ -d "/usr/src/mediawiki/skins" ]; then \
echo "skins exists, removing" && rm -rf /usr/src/mediawiki/skins; fi
RUN git clone --depth 1 https://gerrit.wikimedia.org/r/p/mediawiki/skins.git
# TODO only clone 'Vector', saves time on rebuild
WORKDIR /usr/src/mediawiki/skins
RUN git submodule update --init --recursive \
&& git submodule foreach 'git checkout -b master origin/master || :'
#&& git submodule foreach 'git checkout -b $(MEDIAWIKI_VERSION) origin/$(MEDIAWIKI_VERSION) || :'
WORKDIR /usr/src/mediawiki/
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === 'bf16ac69bd8b807bc6e4499b28968ee87456e29a3894767b60c2d4dafa3d10d045ffef2aeb2e78827fa5f024fbe93ca2') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& mv composer.phar /usr/local/bin/composer \
&& composer update
COPY apache/mediawiki.conf /etc/apache2/sites-available/
RUN rm -rf /etc/apache2/sites-enabled/000-default.conf && \
ln -s /etc/apache2/sites-available/mediawiki.conf /etc/apache2/sites-enabled/mediawiki.conf
#COPY php.ini /etc/php5/conf.d/local.ini
COPY entrypoint.sh /entrypoint.sh
EXPOSE 80 443
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apachectl", "-e", "info", "-D", "FOREGROUND"]