Skip to content

Instantly share code, notes, and snippets.

@mikoj
Last active August 1, 2018 17:58
Show Gist options
  • Save mikoj/b7c7571b5ed2c18eb958af82e03f86da to your computer and use it in GitHub Desktop.
Save mikoj/b7c7571b5ed2c18eb958af82e03f86da to your computer and use it in GitHub Desktop.
FROM php:fpm
# install the PHP extensions we need
RUN apt-get update && apt-get install -y libfreetype6-dev libpng-dev libjpeg62-turbo-dev libmemcached-dev zlib1g-dev && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd mysqli opcache pdo_mysql \
&& pecl install memcached-3.0.4 \
&& docker-php-ext-enable memcached
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment