Skip to content

Commit

Permalink
PHP: drop base image, refactor, added blackfire
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 10, 2016
1 parent a38d47e commit 76883ee
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 130 deletions.
90 changes: 90 additions & 0 deletions php/5.6-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
FROM dockette/jessie

MAINTAINER Milan Sulc <[email protected]>

# SSH
ENV SSH_AUTH_SOCK=/ssh-agent

# PHP
ENV PHP_MODS_DIR=/etc/php5/mods-available
ENV PHP_CLI_CONF_DIR=/etc/php5/cli/conf.d
ENV PHP_CGI_CONF_DIR=/etc/php5/cgi/conf.d
ENV PHP_FPM_CONF_DIR=/etc/php5/fpm/conf.d

# XDEBUG
ENV PHP_IDE_CONFIG="serverName=devstack.webserver"
ENV XDEBUG_CONFIG="idekey=PHPSTORM"

# MAILER
ENV PHPMAILER_BIN=/usr/local/bin/phpmailer
ENV PHPMAILER_PATH=/srv/mails

# DEBUGGING
ENV BLACKFIRE_AGENT=tcp://blackfire:8707

# FILES
ADD conf.d/devstack.ini ${PHP_MODS_DIR}/devstack.ini

# INSTALLATION
RUN apt-get update && apt-get dist-upgrade -y && \
# DEPENDENCIES #############################################################
apt-get install -y wget curl git bash-completion && \
# COMPLETION ###############################################################
cp /etc/skel/.bashrc ~/ && \
cp /etc/skel/.bashrc /home/dfx/ && chown dfx:dfx -R /home/dfx/ && \
# SSH ######################################################################
echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config && \
# PHP DOTDEB ###############################################################
echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
wget http://www.dotdeb.org/dotdeb.gpg && apt-key add dotdeb.gpg && rm dotdeb.gpg && \
apt-get update && \
apt-get install -y \
php5-apcu \
php5-cli \
php5-cgi \
php5-curl \
php5-fpm \
php5-geoip \
php5-gd \
php5-intl \
php5-imagick \
php5-imap \
php5-ldap \
php5-mcrypt \
php5-memcached \
php5-mongo \
php5-mysql \
php5-pgsql \
php5-redis \
php5-sqlite \
php5-ssh2 \
php5-xmlrpc \
php5-xsl \
php5-xdebug && \
# PHPMAILER ################################################################
curl -o ${PHPMAILER_BIN} https://raw.githubusercontent.com/dockette/phpmailer/master/phpmailer && \
mkdir -p ${PHPMAILER_PATH} && \
chmod 755 ${PHPMAILER_BIN} && \
chmod 777 ${PHPMAILER_PATH} && \
# COMPOSER #################################################################
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
composer global require "hirak/prestissimo:^0.3" && \
composer global require bamarni/symfony-console-autocomplete && \
~/.composer/vendor/bin/symfony-autocomplete --shell bash composer | tee /etc/bash_completion.d/composer && \
# BLACKFIRE ################################################################
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/70 && \
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so && \
printf "extension=blackfire.so\nblackfire.agent_socket=${BLACKFIRE_AGENT}\n" > ${PHP_MODS_DIR}/blackfire.ini && \
# PHP MOD(s) ###############################################################
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CLI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CGI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_FPM_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CLI_CONF_DIR}/999-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CGI_CONF_DIR}/999-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_FPM_CONF_DIR}/999-devstack.ini && \
# CLEAN UP #################################################################
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*

CMD ["php"]
File renamed without changes.
File renamed without changes.
86 changes: 86 additions & 0 deletions php/5.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
FROM dockette/jessie

MAINTAINER Milan Sulc <[email protected]>

# SSH
ENV SSH_AUTH_SOCK=/ssh-agent

# PHP
ENV PHP_MODS_DIR=/etc/php5/mods-available
ENV PHP_CLI_CONF_DIR=/etc/php5/cli/conf.d
ENV PHP_CGI_CONF_DIR=/etc/php5/cgi/conf.d

# XDEBUG
ENV PHP_IDE_CONFIG="serverName=devstack.webserver"
ENV XDEBUG_CONFIG="idekey=PHPSTORM"

# MAILER
ENV PHPMAILER_BIN=/usr/local/bin/phpmailer
ENV PHPMAILER_PATH=/srv/mails

# DEBUGGING
ENV BLACKFIRE_AGENT=tcp://blackfire:8707

# FILES
ADD conf.d/devstack.ini ${PHP_MODS_DIR}/devstack.ini

# INSTALLATION
RUN apt-get update && apt-get dist-upgrade -y && \
# DEPENDENCIES #############################################################
apt-get install -y wget curl git bash-completion && \
# COMPLETION ###############################################################
cp /etc/skel/.bashrc ~/ && \
cp /etc/skel/.bashrc /home/dfx/ && chown dfx:dfx -R /home/dfx/ && \
# SSH ######################################################################
echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config && \
# PHP DOTDEB ###############################################################
echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
wget http://www.dotdeb.org/dotdeb.gpg && apt-key add dotdeb.gpg && rm dotdeb.gpg && \
apt-get update && \
apt-get install -y \
php5-apcu \
php5-cli \
php5-cgi \
php5-curl \
php5-geoip \
php5-gd \
php5-intl \
php5-imagick \
php5-imap \
php5-ldap \
php5-mcrypt \
php5-memcached \
php5-mongo \
php5-mysql \
php5-pgsql \
php5-redis \
php5-sqlite \
php5-ssh2 \
php5-xmlrpc \
php5-xsl \
php5-xdebug && \
# PHPMAILER ################################################################
curl -o ${PHPMAILER_BIN} https://raw.githubusercontent.com/dockette/phpmailer/master/phpmailer && \
mkdir -p ${PHPMAILER_PATH} && \
chmod 755 ${PHPMAILER_BIN} && \
chmod 777 ${PHPMAILER_PATH} && \
# COMPOSER #################################################################
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
composer global require "hirak/prestissimo:^0.3" && \
composer global require bamarni/symfony-console-autocomplete && \
~/.composer/vendor/bin/symfony-autocomplete --shell bash composer | tee /etc/bash_completion.d/composer && \
# BLACKFIRE ################################################################
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/70 && \
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so && \
printf "extension=blackfire.so\nblackfire.agent_socket=${BLACKFIRE_AGENT}\n" > ${PHP_MODS_DIR}/blackfire.ini && \
# PHP MOD(s) ###############################################################
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CLI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CGI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CLI_CONF_DIR}/999-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CGI_CONF_DIR}/999-devstack.ini && \
# CLEAN UP #################################################################
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*

CMD ["php"]
File renamed without changes.
93 changes: 93 additions & 0 deletions php/7.0-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
FROM dockette/jessie

MAINTAINER Milan Sulc <[email protected]>

# SSH
ENV SSH_AUTH_SOCK=/ssh-agent

# PHP
ENV PHP_MODS_DIR=/etc/php/7.0/mods-available
ENV PHP_CLI_CONF_DIR=/etc/php/7.0/cli/conf.d
ENV PHP_CGI_CONF_DIR=/etc/php/7.0/cgi/conf.d
ENV PHP_FPM_CONF_DIR=/etc/php/7.0/fpm/conf.d

# XDEBUG
ENV PHP_IDE_CONFIG="serverName=devstack.webserver"
ENV XDEBUG_CONFIG="idekey=PHPSTORM"

# MAILER
ENV PHPMAILER_BIN=/usr/local/bin/phpmailer
ENV PHPMAILER_PATH=/srv/mails

# DEBUGGING
ENV BLACKFIRE_AGENT=tcp://blackfire:8707

# FILES
ADD conf.d/devstack.ini ${PHP_MODS_DIR}/devstack.ini

# INSTALLATION
RUN apt-get update && apt-get dist-upgrade -y && \
# DEPENDENCIES #############################################################
apt-get install -y wget curl git bash-completion && \
# COMPLETION ###############################################################
cp /etc/skel/.bashrc ~/ && \
cp /etc/skel/.bashrc /home/dfx/ && chown dfx:dfx -R /home/dfx/ && \
# SSH ######################################################################
echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config && \
# PHP DOTDEB ###############################################################
echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
wget http://www.dotdeb.org/dotdeb.gpg && apt-key add dotdeb.gpg && rm dotdeb.gpg && \
apt-get update && \
apt-get install -y \
php7.0-apcu \
php7.0-bz2 \
php7.0-cli \
php7.0-cgi \
php7.0-curl \
php7.0-fpm \
php7.0-geoip \
php7.0-gd \
php7.0-intl \
php7.0-imagick \
php7.0-imap \
php7.0-ldap \
php7.0-mbstring \
php7.0-mcrypt \
php7.0-memcached \
php7.0-mongo \
php7.0-mysql \
php7.0-pgsql \
php7.0-redis \
php7.0-sqlite \
php7.0-ssh2 \
php7.0-zip \
php7.0-xmlrpc \
php7.0-xsl \
php7.0-xdebug && \
# PHPMAILER ################################################################
curl -o ${PHPMAILER_BIN} https://raw.githubusercontent.com/dockette/phpmailer/master/phpmailer && \
mkdir -p ${PHPMAILER_PATH} && \
chmod 755 ${PHPMAILER_BIN} && \
chmod 777 ${PHPMAILER_PATH} && \
# COMPOSER #################################################################
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
composer global require "hirak/prestissimo:^0.3" && \
composer global require bamarni/symfony-console-autocomplete && \
~/.composer/vendor/bin/symfony-autocomplete --shell bash composer | tee /etc/bash_completion.d/composer && \
# BLACKFIRE ################################################################
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/70 && \
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so && \
printf "extension=blackfire.so\nblackfire.agent_socket=${BLACKFIRE_AGENT}\n" > ${PHP_MODS_DIR}/blackfire.ini && \
# PHP MOD(s) ###############################################################
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CLI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CGI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_PM_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CLI_CONF_DIR}/999-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CGI_CONF_DIR}/999-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_FPM_CONF_DIR}/999-devstack.ini && \
# CLEAN UP #################################################################
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*

CMD ["php-fpm7.0", "-F"]
16 changes: 16 additions & 0 deletions php/7.0-fpm/conf.d/devstack.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; Update memory
memory_limit = 512M
upload_max_filesize = 2048M
post_max_size = 2048M

; No disabled functions
disable_functions =

; Mailer
sendmail_path = /usr/local/bin/phpmailer

; Xdebug
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
xdebug.remote_host=172.10.10.1
File renamed without changes.
89 changes: 89 additions & 0 deletions php/7.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
FROM dockette/jessie

MAINTAINER Milan Sulc <[email protected]>

# SSH
ENV SSH_AUTH_SOCK=/ssh-agent

# PHP
ENV PHP_MODS_DIR=/etc/php/7.0/mods-available
ENV PHP_CLI_CONF_DIR=/etc/php/7.0/cli/conf.d
ENV PHP_CGI_CONF_DIR=/etc/php/7.0/cgi/conf.d

# XDEBUG
ENV PHP_IDE_CONFIG="serverName=devstack.webserver"
ENV XDEBUG_CONFIG="idekey=PHPSTORM"

# MAILER
ENV PHPMAILER_BIN=/usr/local/bin/phpmailer
ENV PHPMAILER_PATH=/srv/mails

# DEBUGGING
ENV BLACKFIRE_AGENT=tcp://blackfire:8707

# FILES
ADD conf.d/devstack.ini ${PHP_MODS_DIR}/devstack.ini

# INSTALLATION
RUN apt-get update && apt-get dist-upgrade -y && \
# DEPENDENCIES #############################################################
apt-get install -y wget curl git bash-completion && \
# COMPLETION ###############################################################
cp /etc/skel/.bashrc ~/ && \
cp /etc/skel/.bashrc /home/dfx/ && chown dfx:dfx -R /home/dfx/ && \
# SSH ######################################################################
echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config && \
# PHP DOTDEB ###############################################################
echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list && \
wget http://www.dotdeb.org/dotdeb.gpg && apt-key add dotdeb.gpg && rm dotdeb.gpg && \
apt-get update && \
apt-get install -y \
php7.0-apcu \
php7.0-bz2 \
php7.0-cli \
php7.0-cgi \
php7.0-curl \
php7.0-geoip \
php7.0-gd \
php7.0-intl \
php7.0-imagick \
php7.0-imap \
php7.0-ldap \
php7.0-mbstring \
php7.0-mcrypt \
php7.0-memcached \
php7.0-mongo \
php7.0-mysql \
php7.0-pgsql \
php7.0-redis \
php7.0-sqlite \
php7.0-ssh2 \
php7.0-zip \
php7.0-xmlrpc \
php7.0-xsl \
php7.0-xdebug && \
# PHPMAILER ################################################################
curl -o ${PHPMAILER_BIN} https://raw.githubusercontent.com/dockette/phpmailer/master/phpmailer && \
mkdir -p ${PHPMAILER_PATH} && \
chmod 755 ${PHPMAILER_BIN} && \
chmod 777 ${PHPMAILER_PATH} && \
# COMPOSER #################################################################
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
composer global require "hirak/prestissimo:^0.3" && \
composer global require bamarni/symfony-console-autocomplete && \
~/.composer/vendor/bin/symfony-autocomplete --shell bash composer | tee /etc/bash_completion.d/composer && \
# BLACKFIRE ################################################################
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/70 && \
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so && \
printf "extension=blackfire.so\nblackfire.agent_socket=${BLACKFIRE_AGENT}\n" > ${PHP_MODS_DIR}/blackfire.ini && \
# PHP MOD(s) ###############################################################
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CLI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/blackfire.ini ${PHP_CGI_CONF_DIR}/20-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CLI_CONF_DIR}/999-devstack.ini && \
ln -s ${PHP_MODS_DIR}/devstack.ini ${PHP_CGI_CONF_DIR}/999-devstack.ini && \
# CLEAN UP #################################################################
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*

CMD ["php"]
16 changes: 16 additions & 0 deletions php/7.0/conf.d/devstack.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; Update memory
memory_limit = 512M
upload_max_filesize = 2048M
post_max_size = 2048M

; No disabled functions
disable_functions =

; Mailer
sendmail_path = /usr/local/bin/phpmailer

; Xdebug
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
xdebug.remote_host=172.10.10.1
Loading

0 comments on commit 76883ee

Please sign in to comment.