Sign inSign up

thzo/dpfpm

By thzo

Updated over 4 years ago

Image
0

2.3K

thzo/dpfpm repository overview

from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements

FROM php:7.4-fpm-buster

TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

install the PHP extensions we need

RUN set -eux;

if command -v a2enmod; then
a2enmod rewrite;
fi;

savedAptMark="$(apt-mark showmanual)";

apt-get update;
apt-get install -y --no-install-recommends
libfreetype6-dev
libjpeg-dev
libpng-dev
libpq-dev
libzip-dev
curl
vim
git
;

docker-php-ext-configure gd
--with-freetype
--with-jpeg=/usr
;

docker-php-ext-install -j "$(nproc)"
gd
opcache
pdo_mysql
pdo_pgsql
zip
;
\

reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies

apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
	| awk '/=>/ { print $3 }' \
	| sort -u \
	| xargs -r dpkg-query -S \
	| cut -d: -f1 \
	| sort -u \
	| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

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=60';
echo 'opcache.fast_shutdown=1';
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &&
php composer-setup.php &&
mv composer.phar /usr/local/bin/composer &&
php -r "unlink('composer-setup.php');"

WORKDIR /var/www/html

Tag summary

Content type

Image

Digest

Size

135.2 MB

Last updated

over 4 years ago

docker pull thzo/dpfpm