Skip to content

Instantly share code, notes, and snippets.

@yuklia
Created October 19, 2017 20:39
Show Gist options
  • Save yuklia/2b0580f962a0159f0475079a2cc246fa to your computer and use it in GitHub Desktop.
Save yuklia/2b0580f962a0159f0475079a2cc246fa to your computer and use it in GitHub Desktop.
php-fpm docker service container special for Laravel
FROM php:7-fpm
MAINTAINER yuklia
# upgrade the container
RUN apt-get update && \
apt-get upgrade -y
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y --force-yes curl git nano zlib1g-dev nodejs \
&& docker-php-ext-install zip pdo pdo_mysql \
&& docker-php-ext-enable zip
# Install composer
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
printf "\nPATH=\"~/.composer/vendor/bin:\$PATH\"\n" | tee -a ~/.bashrc
RUN pecl install xdebug-2.5.0 \
&& docker-php-ext-enable xdebug
ARG XDEBUG_INI=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.default_enable = off" >> ${XDEBUG_INI} \
&& echo "xdebug.remote_enable = on" >> ${XDEBUG_INI} \
&& echo "xdebug.remote_autostart = off" >> ${XDEBUG_INI} \
&& echo "xdebug.remote_connect_back = off" >> ${XDEBUG_INI} \
&& echo "xdebug.remote_port = 9001" >> ${XDEBUG_INI} \
&& echo "xdebug.remote_host = 10.254.254.254" >> ${XDEBUG_INI} \
&& echo "xdebug.remote_log = /var/www/docker/php/xdebug.log" >> ${XDEBUG_INI}
# composer plugin for parallel install
RUN composer global require "hirak/prestissimo"
RUN composer global require "laravel/envoy"
RUN composer global require "laravel/installer"
RUN ln -s /var/www/artisan /usr/local/bin/ \
&& ln -s /vendor/bin/phpunit /usr/local/bin/
WORKDIR /var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment