File tree 2 files changed +49
-0
lines changed
2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Mediawiki-Nginx
2
+ #
3
+ # Version 1.0
4
+ FROM ubuntu:14.04
5
+ MAINTAINER Matt Renner <
[email protected] >
6
+
7
+ # Ensure UTF-8
8
+ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
9
+ RUN echo deb http://ppa.launchpad.net/nginx/stable/ubuntu trusty main > /etc/apt/sources.list.d/nginx-stable-trusty.list
10
+ RUN apt-get update
11
+ RUN apt-get -y upgrade
12
+
13
+ # Install
14
+ RUN apt-get install -y nginx \
15
+ php5-fpm php5-mysql php-apc php5-imagick php5-imap php5-mcrypt php5-gd libssh2-php
16
+
17
+ RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php5/fpm/php.ini
18
+ ADD nginx.conf /etc/nginx/nginx.conf
19
+ ADD nginx-site.conf /etc/nginx/sites-available/default
20
+ RUN sed -i -e 's/^listen =.*/listen = \/ var\/ run\/ php5-fpm.sock/' /etc/php5/fpm/pool.d/www.conf
21
+
22
+ # Remove the old hello world app and grab Mediawiki source
23
+ RUN git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git /data
24
+
25
+ # Create the section for persistent files
26
+ RUN mkdir /var/lib/mediawiki
27
+
28
+ # Move the files that need to be persistent and create symbolic links to them
29
+ RUN mv /data/images /var/lib/mediawiki/ && ln -s /var/lib/mediawiki/images /data/images
30
+ RUN mv /data/skins /var/lib/mediawiki/ && ln -s /var/lib/mediawiki/skins /data/skins
31
+ RUN touch /var/lib/mediawiki/LocalSettings.php && ln -s /var/lib/mediawiki/LocalSettings.php /data/LocalSettings.php
32
+
33
+ VOLUME ["/var/lib/mediawiki/" ]
34
+
35
+ EXPOSE 80
36
+ ADD start.sh /start.sh
37
+ RUN chmod +x /start.sh
38
+ CMD ["/start.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Starts up Nginx and PHP within the container.
3
+
4
+ DATADIR=" /data"
5
+
6
+ # Don't continue if we catch an error.
7
+ set -e
8
+
9
+ service php5-fpm start
10
+ chmod 666 /var/run/php5-fpm.sock
11
+ /usr/sbin/nginx
You can’t perform that action at this time.
0 commit comments