Created
July 10, 2015 12:32
-
-
Save mRoca/61ab9dcb890a1f57dfc8 to your computer and use it in GitHub Desktop.
docker-nginx-php
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
# Source : https://github.com/mbentley/docker-nginx-php5 | |
FROM debian:jessie | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
php5-fpm \ | |
php5-curl \ | |
php5-intl \ | |
php5-gd \ | |
php5-mcrypt \ | |
php5-mysql \ | |
php5-sqlite \ | |
php5-xdebug \ | |
php-apc \ | |
supervisor \ | |
nginx \ | |
git \ | |
curl \ | |
tar \ | |
wget \ | |
vim \ | |
ca-certificates \ | |
mysql-client \ | |
netcat \ | |
&& apt-get autoremove -y && apt-get clean && rm -r /var/lib/apt/lists/* | |
RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
RUN mkdir /home/composer && COMPOSER_HOME=/home/composer composer global require symfony/var-dumper:2.7 && chmod -R 777 /home/composer | |
RUN mkdir -p /var/lib/nginx /etc/nginx/sites-enabled /etc/nginx/sites-available /var/www | |
ADD nginx.conf /etc/nginx/nginx.conf | |
ADD default /etc/nginx/sites-available/default | |
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/fpm/php.ini && \ | |
sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/cli/php.ini && \ | |
sed -i 's/;daemonize = yes/daemonize = no/g' /etc/php5/fpm/php-fpm.conf && \ | |
sed -i 's/post_max_size = 8M/post_max_size = 16M/g' /etc/php5/fpm/php.ini && \ | |
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 16M/g' /etc/php5/fpm/php.ini && \ | |
sed -i 's/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ALL/g' /etc/php5/fpm/php.ini && \ | |
sed -i "s/display_errors = Off/display_errors = On/" /etc/php5/fpm/php.ini && \ | |
sed -i '/^;catch_workers_output/ccatch_workers_output = yes' /etc/php5/fpm/php-fpm.conf && \ | |
sed -i '/^;error_log/cerror_log = /var/log/php5-fpm.log' /etc/php5/fpm/php-fpm.conf && \ | |
sed -i '/^;php_admin_value\[error_log\]/cphp_admin_value[error_log] = /var/log/php5-fpm.log' /etc/php5/fpm/pool.d/www.conf && \ | |
sed -i '/^;php_admin_flag\[log_errors\]/cphp_admin_flag[log_errors] = on' /etc/php5/fpm/pool.d/www.conf | |
RUN echo "xdebug.remote_enable=1" >> /etc/php5/mods-available/xdebug.ini && \ | |
echo "xdebug.max_nesting_level=1000" >> /etc/php5/mods-available/xdebug.ini && \ | |
echo "xdebug.remote_connect_back=1" >> /etc/php5/mods-available/xdebug.ini | |
RUN echo "auto_prepend_file = /home/composer/vendor/autoload.php" >> /etc/php5/fpm/php.ini && \ | |
echo "auto_prepend_file = /home/composer/vendor/autoload.php" >> /etc/php5/cli/php.ini | |
RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ | |
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ | |
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ | |
&& mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ | |
&& echo "extension=blackfire.so\nblackfire.agent_socket=\${BLACKFIRE_PORT}\nblackfire.log_file=/var/log/blackfire.log\nblackfire.log_level=4" > /etc/php5/fpm/conf.d/blackfire.ini | |
ADD start.sh /opt/start.sh | |
ADD fixtures.sh /opt/fixtures.sh | |
ADD fixtures/ /opt/fixtures/ | |
RUN chmod +x /opt/*.sh | |
EXPOSE 80 | |
VOLUME ["/var/www"] | |
WORKDIR /var/www | |
CMD ["/opt/start.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment