diff --git a/php-dev-base/php-7.4/Dockerfile b/php-dev-base/php-7.4/Dockerfile new file mode 100755 index 0000000..ecb020f --- /dev/null +++ b/php-dev-base/php-7.4/Dockerfile @@ -0,0 +1,80 @@ +FROM php:7.4-fpm + +# Install packages +RUN apt-get update \ + && \ + # apt Debian packages + apt-get install -y \ + apt-utils \ + autoconf \ + ca-certificates \ + curl \ + g++ \ + libonig-dev \ + libbz2-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libpq-dev \ + libssl-dev \ + libicu-dev \ + libmagickwand-dev \ + libzip-dev \ + unzip \ + zip \ + && \ + # pecl PHP extensions + pecl install \ + imagick-3.4.4 \ + redis \ + xdebug-2.9.8 \ + && \ + # Configure PHP extensions + docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ + && \ + # Install PHP extensions + docker-php-ext-install \ + bcmath \ + bz2 \ + exif \ + ftp \ + gettext \ + gd \ + iconv \ + intl \ + mbstring \ + opcache \ + pdo \ + shmop \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + zip \ + && \ + # Enable PHP extensions + docker-php-ext-enable \ + imagick \ + redis \ + xdebug \ + # Clean apt repo caches that don't need to be part of the image + && \ + apt-get clean \ + && \ + # Clean out directories that don't need to be part of the image + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Append our php.ini overrides to the end of the file +RUN echo "upload_max_filesize = 10M" > /usr/local/etc/php/php.ini && \ + echo "post_max_size = 10M" >> /usr/local/etc/php/php.ini && \ + echo "max_execution_time = 300" >> /usr/local/etc/php/php.ini && \ + echo "memory_limit = 256M" >> /usr/local/etc/php/php.ini && \ + echo "opcache.revalidate_freq = 0" >> /usr/local/etc/php/php.ini && \ + echo "opcache.validate_timestamps = 1" >> /usr/local/etc/php/php.ini + +# Copy the `xdebug.ini` file into place for xdebug +COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini + +# Copy the `zzz-docker.conf` file into place for php-fpm +COPY ./zzz-docker.conf /usr/local/etc/php-fpm.d/zzz-docker.conf diff --git a/php-dev-base/php-7.4/xdebug.ini b/php-dev-base/php-7.4/xdebug.ini new file mode 100644 index 0000000..99fd3be --- /dev/null +++ b/php-dev-base/php-7.4/xdebug.ini @@ -0,0 +1,6 @@ +xdebug.default_enable=1 +xdebug.remote_enable=1 +xdebug.remote_port=9003 +xdebug.remote_handler=dbgp +xdebug.remote_host=host.docker.internal +xdebug.remote_autostart=1 diff --git a/php-dev-base/php-7.4/zzz-docker.conf b/php-dev-base/php-7.4/zzz-docker.conf new file mode 100755 index 0000000..1e668d5 --- /dev/null +++ b/php-dev-base/php-7.4/zzz-docker.conf @@ -0,0 +1,4 @@ +[www] +pm.max_children = 10 +pm.process_idle_timeout = 10s +pm.max_requests = 1000 diff --git a/php-prod-base/php-7.4/Dockerfile b/php-prod-base/php-7.4/Dockerfile new file mode 100755 index 0000000..23f0085 --- /dev/null +++ b/php-prod-base/php-7.4/Dockerfile @@ -0,0 +1,76 @@ +FROM php:7.4-fpm + +# Install packages +RUN apt-get update \ + && \ + # apt Debian packages + apt-get install -y \ + apt-utils \ + autoconf \ + ca-certificates \ + curl \ + g++ \ + libonig-dev \ + libbz2-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libpq-dev \ + libssl-dev \ + libicu-dev \ + libmagickwand-dev \ + libzip-dev \ + unzip \ + zip \ + && \ + # pecl PHP extensions + pecl install \ + imagick-3.4.4 \ + redis \ + && \ + # Configure PHP extensions + docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ + && \ + # Install PHP extensions + docker-php-ext-install \ + bcmath \ + bz2 \ + exif \ + ftp \ + gettext \ + gd \ + iconv \ + intl \ + mbstring \ + opcache \ + pdo \ + shmop \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + zip \ + && \ + # Enable PHP extensions + docker-php-ext-enable \ + imagick \ + redis \ + # Clean apt repo caches that don't need to be part of the image + && \ + apt-get clean \ + && \ + # Clean out directories that don't need to be part of the image + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + + +# Append our php.ini overrides to the end of the file +RUN echo "upload_max_filesize = 10M" > /usr/local/etc/php/php.ini && \ + echo "post_max_size = 10M" >> /usr/local/etc/php/php.ini && \ + echo "max_execution_time = 300" >> /usr/local/etc/php/php.ini && \ + echo "memory_limit = 256M" >> /usr/local/etc/php/php.ini && \ + echo "opcache.revalidate_freq = 0" >> /usr/local/etc/php/php.ini && \ + echo "opcache.validate_timestamps = 1" >> /usr/local/etc/php/php.ini + +# Copy the `zzz-docker.conf` file into place for php-fpm +COPY ./zzz-docker.conf /usr/local/etc/php-fpm.d/zzz-docker.conf diff --git a/php-prod-base/php-7.4/zzz-docker.conf b/php-prod-base/php-7.4/zzz-docker.conf new file mode 100755 index 0000000..1e668d5 --- /dev/null +++ b/php-prod-base/php-7.4/zzz-docker.conf @@ -0,0 +1,4 @@ +[www] +pm.max_children = 10 +pm.process_idle_timeout = 10s +pm.max_requests = 1000