Created
October 22, 2018 22:19
-
-
Save PeterBooker/ca19266718af9451ecd284f5da9f9dee to your computer and use it in GitHub Desktop.
PHP-FPM Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm-alpine | |
#FROM php:7.3.0RC3-fpm-alpine3.8 | |
# install PHP extensions | |
RUN apk add --no-cache --virtual .build-deps \ | |
freetype-dev \ | |
libjpeg-turbo-dev \ | |
libpng-dev | |
RUN docker-php-ext-install \ | |
bcmath \ | |
mbstring \ | |
mysqli \ | |
pdo_mysql \ | |
pdo \ | |
gd \ | |
opcache \ | |
exif | |
RUN apk add --no-cache --update \ | |
php7-session \ | |
php7-dom \ | |
php7-xml \ | |
php7-xmlreader \ | |
php7-ctype \ | |
php7-ftp \ | |
php7-json \ | |
php7-curl \ | |
php7-sockets \ | |
php7-zlib \ | |
php7-mcrypt \ | |
php7-bz2 \ | |
php7-phar \ | |
php7-openssl \ | |
php7-posix \ | |
php7-zip \ | |
php7-calendar \ | |
php7-iconv \ | |
php7-imap \ | |
php7-soap \ | |
php7-dev \ | |
php7-pear \ | |
php7-redis \ | |
php7-mbstring \ | |
php7-exif \ | |
php7-xsl \ | |
php7-bcmath | |
RUN docker-php-ext-enable \ | |
bcmath \ | |
mbstring \ | |
mysqli \ | |
pdo_mysql \ | |
pdo \ | |
gd \ | |
opcache \ | |
exif | |
RUN apk add --update --no-cache autoconf g++ imagemagick-dev libtool make pcre-dev \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick \ | |
&& apk del autoconf g++ libtool make pcre-dev \ | |
&& echo 'extension=imagick.so' > /usr/local/etc/php/conf.d/memcached.ini | |
# 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 | |
# Cleanup | |
RUN apk del --purge \ | |
*-dev | |
VOLUME /var/www/html | |
CMD ["php-fpm"] | |
EXPOSE 9000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment