Skip to content

Commit

Permalink
Added PHP 7.4 images for php-dev-base and php-prod-base
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Welch <[email protected]>
  • Loading branch information
khalwat committed Dec 22, 2020
1 parent 61acd16 commit bbc2fe1
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 0 deletions.
80 changes: 80 additions & 0 deletions php-dev-base/php-7.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions php-dev-base/php-7.4/xdebug.ini
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions php-dev-base/php-7.4/zzz-docker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[www]
pm.max_children = 10
pm.process_idle_timeout = 10s
pm.max_requests = 1000
76 changes: 76 additions & 0 deletions php-prod-base/php-7.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions php-prod-base/php-7.4/zzz-docker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[www]
pm.max_children = 10
pm.process_idle_timeout = 10s
pm.max_requests = 1000

0 comments on commit bbc2fe1

Please sign in to comment.