-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
75 lines (54 loc) · 1.99 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
ARG mediawiki_version=1.41.2-fpm
ARG composer_version=2.7.1
# Trick to allow for COPY from for composer image
FROM composer:${composer_version} AS composer
FROM mediawiki:${mediawiki_version}
# Create script directory
RUN mkdir /wiki/
# Apply custom patches
COPY ./patches/ /var/www/html/patches/
RUN for i in /var/www/html/patches/*.patch; do patch -p1 < $i; done
# Copy extensions to the image
COPY ./extensions/ /var/www/html/extensions/
# Copy skins to the image
COPY ./skins/ /var/www/html/skins/
# Copy custom LocalSettings.php
COPY ./conf/LocalSettings.php /var/www/html/LocalSettings.php
# Composer
RUN apt update
RUN apt install zip unzip
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
# Semantic Mediawiki
COPY ./conf/composer.local.json /var/www/html/composer.local.json
RUN chown -R root ./composer.json
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN /usr/local/bin/composer config --no-plugins allow-plugins.wikimedia/composer-merge-plugin
RUN /usr/local/bin/composer update --no-dev
# NGINX
RUN apt-get update -y \
&& apt-get install -y nginx
# Custom NGINX configuration
COPY ./conf/nginx.conf /etc/nginx/sites-enabled/default
# Supervisor daemon
RUN apt-get update && \
apt-get install -y supervisor --no-install-recommends
COPY ./conf/supervisord.conf /etc/supervisor/conf.d/
# Cron
RUN apt-get install -y cron --no-install-recommends
RUN mkdir /wiki/cron
# Add cron files
ADD cron/update_spamlist.sh /wiki/cron/update_spamlist.sh
ADD cron/run_jobs.sh /wiki/cron/run_jobs.sh
# Update permissions
RUN chmod 0644 /wiki/cron/update_spamlist.sh
# Update crontab
RUN crontab -l | { cat; echo "0 0 * * * bash /wiki/cron/update_spamlist.sh"; } | crontab -
RUN crontab -l | { cat; echo "0 * * * * bash /wiki/cron/run_jobs.sh"; } | crontab -
# Imagemagick
RUN apt-get install -y imagemagick --no-install-recommends
# Image directory
RUN chmod 766 /var/www/html/images
# Custom entrypoint
COPY entrypoint.sh /etc/entrypoint.sh
RUN chmod +x /etc/entrypoint.sh
ENTRYPOINT ["/etc/entrypoint.sh"]