Skip to content

Instantly share code, notes, and snippets.

@kevtainer
Created October 1, 2015 20:40
Show Gist options
  • Save kevtainer/a322ef377e29b01760c4 to your computer and use it in GitHub Desktop.
Save kevtainer/a322ef377e29b01760c4 to your computer and use it in GitHub Desktop.
PHP5.6 latest FPM with Laravel 5.* deps and some stupid pecl stuff
FROM php:5.6-fpm
# compile + install xdebug
RUN curl -SL "http://xdebug.org/files/xdebug-2.3.3.tgz" -o xdebug.tar.xz \
&& mkdir -p /usr/src/xdebug \
&& tar -xof xdebug.tar.xz -C /usr/src/xdebug --strip-components=1 \
&& rm xdebug.tar.xz \
&& cd /usr/src/xdebug \
&& phpize \
&& ./configure \
&& make -j"$(nproc)" \
&& cp modules/xdebug.so "$(php -r 'echo ini_get("extension_dir");')"
# Install modules
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
# required by laravel
libmcrypt-dev \
libpng12-dev \
# even tho docs say its not required by pecl_http, it is.
libcurl4-openssl-dev \
# mycrypt + mbstring is required by laravel
&& docker-php-ext-install iconv mcrypt mbstring pdo \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& printf "\n" | pecl install raphf propro \
&& docker-php-ext-enable raphf propro \
&& printf "\n" | pecl install pecl_http \
&& docker-php-ext-enable http
# dumb hack to make shares writable by the server whilst docker is running on osx
RUN usermod -u 1000 www-data
CMD ["php-fpm"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment