Skip to content

Instantly share code, notes, and snippets.

@ktquez
Forked from zz/php7.Dockerfile
Created October 11, 2016 07:14
Show Gist options
  • Save ktquez/bb85efa85316bc9af01dcf12dc72970e to your computer and use it in GitHub Desktop.
Save ktquez/bb85efa85316bc9af01dcf12dc72970e to your computer and use it in GitHub Desktop.
Dockerfile for PHP7 memcache and Redis ext
FROM php:7-fpm
# Install modules
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libmemcached-dev \
libmysqlclient-dev \
libicu-dev \
libpq-dev \
curl \
&& docker-php-ext-install iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install intl \
&& docker-php-ext-install pdo_pgsql \
&& curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
&& mkdir -p /usr/src/php/ext/memcached \
&& tar -C /usr/src/php/ext/memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
&& docker-php-ext-configure memcached \
&& docker-php-ext-install memcached \
&& rm /tmp/memcached.tar.gz \
&& mkdir -p /usr/src/php/ext/redis \
&& curl -L https://github.com/phpredis/phpredis/archive/3.0.0.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 \
&& echo 'redis' >> /usr/src/php-available-exts \
&& docker-php-ext-install redis
RUN echo "America/Los_Angeles" > /etc/timezone; dpkg-reconfigure -f noninteractive tzdata
CMD ["php-fpm"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment