1- FROM ubuntu:14.04
2- MAINTAINER Sukru Uzel <uzelsukru@gmail.com>
3-
4- # Keep upstart
5- RUN dpkg-divert --local --rename --add /sbin/initctl && ln -sf /bin/true /sbin/initctl
6-
7- # Set no tty
8- ENV DEBIAN_FRONTEND noninteractive
9- ENV MYSQL_DB pw_db
10- ENV MYSQL_USER pw_user
11- ENV MYSQL_PASS pw_pass
12-
13- # Update System
14- RUN apt-get update && apt-get -y upgrade
15-
16- # Basic Requirements
17- RUN apt-get install -y pwgen --force-yes python-setuptools curl git unzip \
18- mysql-server mysql-client \
19- nginx \
20- php5-fpm php5-mysql php-apc php5-cli php5-curl php5-gd php5-mcrypt php5-intl \
21- php5-imap php5-tidy php5-imagick php5-memcache php5-xmlrpc php5-xsl
22-
23- # MySQL Config
24- RUN sed -i -e"s/^bind-address\s *=\s *127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
25-
26- # Nginx Config
27- RUN sed -i -e"s/keepalive_timeout\s *65/keepalive_timeout 2/" /etc/nginx/nginx.conf && \
28- sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\t client_max_body_size 100m/" /etc/nginx/nginx.conf && \
29- echo "daemon off;" >> /etc/nginx/nginx.conf
30- ADD ./config/nginx-site.conf /etc/nginx/sites-available/default
31-
32- # PHP Config
33- RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini && \
34- sed -i -e "s/upload_max_filesize\s *=\s *2M/upload_max_filesize = 100M/g" /etc/php5/fpm/php.ini && \
35- sed -i -e "s/post_max_size\s *=\s *8M/post_max_size = 100M/g" /etc/php5/fpm/php.ini && \
36- sed -i -e "s/;daemonize\s *=\s *yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf && \
37- sed -i -e "s/;catch_workers_output\s *=\s *yes/catch_workers_output = yes/g" /etc/php5/fpm/pool.d/www.conf && \
38- find /etc/php5/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s *)#(.*)/\1 ;\2 /g' {} \;
39-
40- # ProcessWire Install
41- RUN git clone git://github.com/ryancramerdesign/ProcessWire.git -b master && cd ProcessWire/ && rm -rf .git
42-
43- # Supervisor Config
44- RUN easy_install supervisor
45- ADD ./config/supervisord.conf /etc/supervisord.conf
46-
47- # Volume
48- VOLUME ["/var/lib/mysql" , "/usr/share/nginx" ]
1+ FROM ubuntu:16.04
2+ MAINTAINER Sukru Uzel <sukru.uzel@gmail.com>
3+
4+ # Packages installation
5+ RUN apt-get update && \
6+ apt-get dist-upgrade -y && \
7+ apt-get install -y \
8+ git \
9+ apache2 \
10+ libapache2-mod-php7.0 \
11+ php7.0 \
12+ php7.0-cli \
13+ php7.0-gd \
14+ php7.0-json \
15+ php7.0-ldap \
16+ php7.0-mbstring \
17+ php7.0-mysql \
18+ php7.0-xml \
19+ php7.0-xsl \
20+ php7.0-zip \
21+ php7.0-soap
22+
23+ # Update the default apache site with the config we created.
24+ COPY config/apache/default.conf /etc/apache2/sites-available/000-default.conf
25+ RUN a2enmod rewrite
26+
27+ # Update php.ini
28+ RUN sed -ri 's/^display_errors\s *=\s *Off/display_errors = On/g' /etc/php/7.0/apache2/php.ini
29+ RUN sed -ri 's/^display_errors\s *=\s *Off/display_errors = On/g' /etc/php/7.0/cli/php.ini
30+
31+ # Install ProcessWire
32+ RUN git clone git://github.com/ryancramerdesign/ProcessWire.git -b master /var/www/pw
33+ RUN chown -R www-data:www-data /var/www/pw
4934
5035# Expose
5136EXPOSE 80
52- EXPOSE 3306
5337
54- # Startup Script
55- ADD ./scripts/start.sh /scripts/start.sh
56- RUN chmod 755 /scripts/start.sh
57- CMD ["/bin/bash" , "/scripts/start.sh" ]
38+ # Volume
39+ VOLUME ["/var/www/pw" ]
5840
5941# Clean
60- RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
42+ RUN apt-get clean && \
43+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/www/pw/.git
44+
45+ # Init
46+ ADD scripts/init.sh /init.sh
47+ RUN chmod +x /init.sh
48+ CMD ["/init.sh" ]
0 commit comments