Created
March 23, 2015 14:44
-
-
Save danielnegri/a7c5c1d742d42ad9e5ea to your computer and use it in GitHub Desktop.
Docker - agambiarra.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
MAINTAINER Daniel Negri <danielnegri@byoc.io> | |
# Keep upstart from complaining | |
RUN dpkg-divert --local --rename --add /sbin/initctl | |
RUN ln -sf /bin/true /sbin/initctl | |
# Let the conatiner know that there is no tty | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
# Basic Requirements | |
RUN apt-get -y install mysql-client nginx php5-fpm php5-mysql php-apc pwgen python-setuptools curl htop git unzip vim wget | |
# Wordpress Requirements | |
RUN apt-get -y install php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl | |
# nginx config | |
RUN sed -i -e"s/keepalive_timeout\s*65/keepalive_timeout 2/" /etc/nginx/nginx.conf | |
RUN sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\tclient_max_body_size 100m/" /etc/nginx/nginx.conf | |
RUN echo "daemon off;" >> /etc/nginx/nginx.conf | |
# New Relic | |
RUN wget -O - https://download.newrelic.com/548C16BF.gpg | sudo apt-key add - | |
RUN echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt/sources.list.d/newrelic.list | |
RUN apt-get update | |
RUN apt-get install -y newrelic-php5 | |
RUN newrelic-install install | |
COPY ./newrelic.ini /etc/php5/mods-available/newrelic.ini | |
# php-fpm config | |
RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini | |
RUN sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php5/fpm/php.ini | |
RUN sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php5/fpm/php.ini | |
RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf | |
RUN sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" /etc/php5/fpm/pool.d/www.conf | |
RUN find /etc/php5/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \; | |
RUN touch /var/log/php5-fpm.log | |
# nginx site conf | |
ADD ./nginx-default.conf /etc/nginx/sites-available/default | |
ADD ./ssl /etc/nginx/ssl | |
# Supervisor Config | |
RUN /usr/bin/easy_install supervisor | |
RUN /usr/bin/easy_install supervisor-stdout | |
ADD ./supervisord.conf /etc/supervisord.conf | |
# Cleaning APT | |
RUN apt-get clean | |
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# private expose | |
EXPOSE 80 | |
EXPOSE 443 | |
# volume for wordpress install | |
VOLUME ["/var/www/agambiarra.com"] | |
# start all the services | |
CMD ["/usr/local/bin/supervisord", "-n"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment