* big pre-summer refactoring

+ introduce php7.4 and stay only php7.3 as max older version
+ workspace with php7.4 in future commits
This commit is contained in:
2021-04-13 00:01:26 +03:00
parent 998509196d
commit f3139e9716
34 changed files with 1013 additions and 606 deletions

View File

@ -0,0 +1,9 @@
; Load igbinary extension
;extension=igbinary.so
; Use igbinary as session serializer
session.serialize_handler=igbinary
; Enable or disable compacting of duplicate strings
; The default is On.
igbinary.compact_strings=On

View File

@ -1,4 +1,3 @@
FROM php:7.3-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
@ -10,12 +9,16 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install mysqli \
&& docker-php-ext-enable mysqli
RUN apt-get update && docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo pdo_mysql
RUN apt-get update && docker-php-ext-install pdo pdo_mysql \
&& docker-php-ext-enable pdo pdo_mysql
###########################################################################
# xDebug:
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
@ -23,30 +26,25 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install xdebug-2.5.5; \
else \
pecl install xdebug; \
pecl install xdebug-2.9.8; \
fi && \
docker-php-ext-enable xdebug && \
sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
;fi
# Copy xdebug configuration for remote debugging
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
###########################################################################
# Redis and igbinary:
###########################################################################
ARG INSTALL_REDIS=false
COPY ./igbinary.ini /usr/local/etc/php/conf.d/igbinary.ini
RUN if [ ${INSTALL_REDIS} = true ]; then \
pecl install igbinary \
&& pecl install -a redis \
&& docker-php-ext-enable igbinary redis \
pecl install -a igbinary \
&& docker-php-ext-enable igbinary \
&& printf "yes\n" | pecl install redis \
&& docker-php-ext-enable redis \
;fi
###########################################################################
@ -62,17 +60,7 @@ RUN if [ ${INSTALL_ZIP} = true ]; then \
;fi
###########################################################################
# Pear Mail and Mail_Mime:
###########################################################################
ARG INSTALL_PEAR_MAIL=false
RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
pear install Mail && pear install Mail_Mime \
;fi
###########################################################################
# BZ2 function:
# BZ2:
###########################################################################
ARG INSTALL_BZ2=false
@ -84,7 +72,7 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
;fi
###########################################################################
# INTL function:
# INTL:
###########################################################################
ARG INSTALL_INTL=false
@ -96,6 +84,38 @@ RUN if [ ${INSTALL_INTL} = true ]; then \
;fi
###########################################################################
# PGSQL:
###########################################################################
ARG INSTALL_PGSQL=false
RUN if [ ${INSTALL_PGSQL} = true ]; then \
apt update && apt install -y libpq-dev \
&& docker-php-ext-install pgsql \
&& docker-php-ext-install pdo_pgsql \
;fi
###########################################################################
# BCMATH:
###########################################################################
ARG INSTALL_BCMATH=false
RUN if [ ${INSTALL_BCMATH} = true ]; then \
&& docker-php-ext-install bcmath \
;fi
###########################################################################
# Pear Mail and Mail_Mime:
###########################################################################
ARG INSTALL_PEAR_MAIL=false
RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
pear install Mail && pear install Mail_Mime \
;fi
###########################################################################
# php.ini opts:
###########################################################################
@ -103,19 +123,15 @@ RUN if [ ${INSTALL_INTL} = true ]; then \
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MAX_EXECUTION_TIME=30
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MEMORY_LIMIT=128M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
@ -127,24 +143,11 @@ RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MA
RUN sed -i "s/^log_limit = .*/log_limit = 1024/g" "$PHP_INI_DIR/../php-fpm.d/docker.conf"
###########################################################################
# BCMATH functions:
# Locales:
###########################################################################
RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath
###########################################################################
# GEOIP:
###########################################################################
RUN apt update \
&& apt install -y libgeoip-dev wget \
&& rm -rf /var/lib/apt/lists/* \
&& pecl install geoip-1.1.1 \
&& docker-php-ext-enable geoip
###########################################################################
# PGSQL:
###########################################################################
RUN apt-get update && apt install -y libpq-dev \
&& docker-php-ext-install pdo_pgsql && docker-php-ext-enable pdo_pgsql
RUN apt update && \
apt install -y locales && \
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen

View File

@ -0,0 +1,4 @@
# syntax = edrevo/dockerfile-plus
FROM php:7.3-fpm
INCLUDE+ ./php-fpm.base.Dockerfile

View File

@ -0,0 +1,4 @@
# syntax = edrevo/dockerfile-plus
FROM php:7.4-fpm
INCLUDE+ ./php-fpm.base.Dockerfile

View File

@ -2,9 +2,10 @@
# NOTE: At the moment, this has only been confirmed to work with PHP 7
PHP_VERSION=$1
# Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker ps | grep php-fpm | awk '{print $1}')
PHP_FPM_CONTAINER=$(docker ps | grep php-fpm${PHP_VERSION} | awk '{print $1}')
# Grab OS type