@@ -2,53 +2,50 @@ FROM ubuntu:14.04
22MAINTAINER Sukru Uzel <uzelsukru@gmail.com>
33
44# Keep upstart
5- RUN dpkg-divert --local --rename --add /sbin/initctl
6- RUN ln -sf /bin/true /sbin/initctl
5+ RUN dpkg-divert --local --rename --add /sbin/initctl && ln -sf /bin/true /sbin/initctl
76
87# Set no tty
98ENV DEBIAN_FRONTEND noninteractive
10- ENV MYSQL_DB processwire
11- ENV MYSQL_USER processwire
12- ENV MYSQL_PASS processwire
9+ ENV MYSQL_DB pw_db
10+ ENV MYSQL_USER pw_user
11+ ENV MYSQL_PASS pw_pass
1312
1413# Update System
15- RUN apt-get update
16- RUN apt-get -y upgrade
14+ RUN apt-get update && apt-get -y upgrade
1715
1816# Basic Requirements
1917RUN apt-get install -y pwgen --force-yes python-setuptools curl git unzip \
20- mysql-server mysql-client \
21- nginx \
22- php5-fpm php5-mysql php-apc php5-cli php5-curl php5-gd php5-mcrypt php5-intl \
23- php5-imap php5-tidy php5-imagick php5-memcache php5-xmlrpc php5-xsl
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
2422
2523# MySQL Config
2624RUN sed -i -e"s/^bind-address\s *=\s *127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
2725
2826# Nginx Config
29- RUN sed -i -e"s/keepalive_timeout\s *65/keepalive_timeout 2/" /etc/nginx/nginx.conf
30- RUN sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\t client_max_body_size 100m/" /etc/nginx/nginx.conf
31- RUN echo "daemon off;" >> /etc/nginx/nginx.conf
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
3230ADD ./config/nginx-site.conf /etc/nginx/sites-available/default
3331
3432# PHP Config
35- RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini
36- RUN sed -i -e "s/upload_max_filesize\s *=\s *2M/upload_max_filesize = 100M/g" /etc/php5/fpm/php.ini
37- RUN sed -i -e "s/post_max_size\s *=\s *8M/post_max_size = 100M/g" /etc/php5/fpm/php.ini
38- RUN sed -i -e "s/;daemonize\s *=\s *yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf
39- RUN sed -i -e "s/;catch_workers_output\s *=\s *yes/catch_workers_output = yes/g" /etc/php5/fpm/pool.d/www.conf
40- RUN find /etc/php5/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s *)#(.*)/\1 ;\2 /g' {} \;
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' {} \;
4139
4240# ProcessWire Install
43- RUN git clone git://github.com/ryancramerdesign/ProcessWire.git -b master
44- RUN cd ProcessWire/ && rm -rf .git
41+ RUN git clone git://github.com/ryancramerdesign/ProcessWire.git -b master && cd ProcessWire/ && rm -rf .git
4542
4643# Supervisor Config
4744RUN easy_install supervisor
4845ADD ./config/supervisord.conf /etc/supervisord.conf
4946
5047# Volume
51- VOLUME ["/usr/share/nginx" ]
48+ VOLUME ["/var/lib/mysql" , "/ usr/share/nginx" ]
5249
5350# Expose
5451EXPOSE 80
0 commit comments