diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e19b0af0..ae608d5c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -41,11 +41,10 @@ jobs: PHP_VERSION=7.3 UBUNTU_VERSION=24.04 - version: 7.4 - file: Dockerfile + file: 7.x.Dockerfile build-args: | PHP_VERSION=7.4 UBUNTU_VERSION=20.04 - XDEBUG_VERSION=3.1.6 - version: 8.0 file: 8.x.Dockerfile build-args: | @@ -71,6 +70,11 @@ jobs: build-args: | PHP_VERSION=8.4 UBUNTU_VERSION=24.04 + - version: 8.5 + file: 8.x.Dockerfile + build-args: | + PHP_VERSION=8.5 + UBUNTU_VERSION=24.04 steps: - name: Checkout diff --git a/build-container.sh b/build-container.sh index 30655325..1e545f7c 100755 --- a/build-container.sh +++ b/build-container.sh @@ -57,20 +57,17 @@ docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.3 --build-arg PHP_VERS docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cron-dev php docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-supervisor php -docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-fpm php -docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cli php -docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-fpm-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cli-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cron php -docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cron-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-supervisor php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-fpm php +docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cli php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-fpm-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cli-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cron php +docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cron-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-supervisor php docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm php docker buildx build -t ghcr.io/netlogix/docker/php-cli:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli php -docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli-dev php docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.0--build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron php -docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.1 --build-arg PHP_VERSION=8.1 --build-arg UBUNTU_VERSION=22.04 -f php/Dockerfile --target=php-fpm php @@ -105,6 +102,14 @@ docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.4 --build-arg PHP_VERS docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.4 --build-arg PHP_VERSION=8.4 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.4 --build-arg PHP_VERSION=8.4 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm php +docker buildx build -t ghcr.io/netlogix/docker/php-cli:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron php +docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php + docker buildx build -t ghcr.io/netlogix/docker/frankenphp:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp php docker buildx build -t ghcr.io/netlogix/docker/frankenphp-dev:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-dev php docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-cli php diff --git a/php/8.x.Dockerfile b/php/8.x.Dockerfile index 57e2610a..ddc0a528 100644 --- a/php/8.x.Dockerfile +++ b/php/8.x.Dockerfile @@ -3,8 +3,8 @@ ARG UBUNTU_VERSION=24.04 FROM ubuntu:${UBUNTU_VERSION} AS base ARG PHP_VERSION=8.4 -# renovate: datasource=github-releases depName=xdebug packageName=xdebug/xdebug -ARG XDEBUG_VERSION=3.5.0 +# renovate: datasource=github-releases depName=php-pie packageName=php/pie +ARG PHP_PIE_VERSION=1.3.1 ENV DEBIAN_FRONTEND=noninteractive \ TZ="Europe/Berlin" \ @@ -28,7 +28,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_OPCACHE_PRELOAD_USER=www-data \ PHP_OPCACHE_ENABLE_CLI=0 \ PHP_OPCACHE_VALIDATE_TIMESTAMPS=1 \ - PHP_OPCACHE_FILE_CACHE=null \ + PHP_OPCACHE_FILE_CACHE="/tmp/opcache" \ PHP_OPCACHE_FILE_CACHE_ONLY=0 \ PHP_OPCACHE_REVALIDATE_FREQ=2 \ PHP_REALPATH_CACHE_TTL=120 \ @@ -44,7 +44,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_FPM_PM_MIN_SPARE_SERVERS=2 \ PHP_FPM_PM_MAX_SPARE_SERVERS=4 \ PHP_FPM_PM_MAX_REQUESTS=1000 \ - XDEBUG_VERSION=${XDEBUG_VERSION} \ + PHP_PIE_VERSION=${PHP_PIE_VERSION} \ TIDEWAYS_APIKEY="" \ TIDEWAYS_AUTO_START=1 \ TIDEWAYS_DAEMON="tcp://tideways-daemon:9135" \ @@ -92,7 +92,6 @@ RUN apt-get update && \ php${PHP_VERSION}-intl \ php${PHP_VERSION}-mbstring \ php${PHP_VERSION}-mysql \ - php${PHP_VERSION}-opcache \ php${PHP_VERSION}-pgsql \ php${PHP_VERSION}-raphf \ php${PHP_VERSION}-readline \ @@ -104,6 +103,10 @@ RUN apt-get update && \ php${PHP_VERSION}-zip \ tideways-php \ tideways-cli \ + # install opcache when php version is not 8.5. Opcache is now part of the php binary \ + && if [ "${PHP_VERSION}" != "8.5" ]; then \ + apt-get -y install --no-install-suggests --no-install-recommends php${PHP_VERSION}-opcache; \ + fi \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ && rm -rf /var/lib/apt/lists/* /var/cache/ldconfig/aux-cache \ @@ -128,6 +131,8 @@ RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm RUN mkdir -p "/run/php/" \ && chown -R www-data:www-data /run/php/ \ && chmod 755 /run/php/ \ + && mkdir -p ${PHP_OPCACHE_FILE_CACHE} \ + && chown -R www-data:www-data ${PHP_OPCACHE_FILE_CACHE} \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log @@ -206,13 +211,12 @@ ENV PHP_IDE_CONFIG="serverName=localhost" RUN apt-get update && \ apt-get -y install --no-install-suggests --no-install-recommends \ - make php${PHP_VERSION}-dev php-pear openssh-client git patch \ - && mkdir -p /tmp/pear/cache \ - && pecl channel-update pecl.php.net \ - && pecl install xdebug-${XDEBUG_VERSION} \ - && echo "zend_extension=xdebug.so" > /etc/php/${PHP_VERSION}/mods-available/xdebug.ini \ + make php${PHP_VERSION}-dev openssh-client git patch \ + && curl -L -sS https://github.com/php/pie/releases/download/${PHP_PIE_VERSION}/pie.phar -o /usr/local/bin/pie \ + && chmod +x /usr/local/bin/pie \ + && pie install xdebug/xdebug \ && phpenmod xdebug \ - && apt-get -y autoremove --purge make php${PHP_VERSION}-dev php-pear \ + && apt-get -y autoremove --purge make php${PHP_VERSION}-dev \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ && rm -rf /root/.pearrc \ @@ -223,6 +227,8 @@ RUN apt-get update && \ && rm -rf /usr/share/bug/file \ && rm -rf /usr/share/doc/file \ && rm -rf /var/lib/apt/lists/* /var/cache/ldconfig/aux-cache \ + && rm -rf /root/.config/pie \ + && rm /usr/local/bin/pie \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log diff --git a/php/Dockerfile b/php/Dockerfile index a3a2a2fc..d3a61e32 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -2,9 +2,9 @@ # check=skip=SecretsUsedInArgOrEnv ARG UBUNTU_VERSION=24.04 FROM ubuntu:${UBUNTU_VERSION} AS base -ARG PHP_VERSION=8.3 -# renovate: datasource=github-releases depName=xdebug packageName=xdebug/xdebug -ARG XDEBUG_VERSION=3.5.0 +ARG PHP_VERSION=8.4 +# renovate: datasource=github-releases depName=php-pie packageName=php/pie +ARG PHP_PIE_VERSION=1.3.1 ENV DEBIAN_FRONTEND=noninteractive \ TZ="Europe/Berlin" \ @@ -28,7 +28,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_OPCACHE_PRELOAD_USER=www-data \ PHP_OPCACHE_ENABLE_CLI=0 \ PHP_OPCACHE_VALIDATE_TIMESTAMPS=1 \ - PHP_OPCACHE_FILE_CACHE=null \ + PHP_OPCACHE_FILE_CACHE="/tmp/opcache" \ PHP_OPCACHE_FILE_CACHE_ONLY=0 \ PHP_OPCACHE_REVALIDATE_FREQ=2 \ PHP_REALPATH_CACHE_TTL=120 \ @@ -44,7 +44,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_FPM_PM_MIN_SPARE_SERVERS=2 \ PHP_FPM_PM_MAX_SPARE_SERVERS=4 \ PHP_FPM_PM_MAX_REQUESTS=1000 \ - XDEBUG_VERSION=${XDEBUG_VERSION} \ + PHP_PIE_VERSION=${PHP_PIE_VERSION} \ TIDEWAYS_APIKEY="" \ TIDEWAYS_AUTO_START=1 \ TIDEWAYS_DAEMON="tcp://tideways-daemon:9135" \ @@ -124,6 +124,8 @@ RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm RUN mkdir -p "/run/php/" \ && chown -R www-data:www-data /run/php/ \ && chmod 755 /run/php/ \ + && mkdir -p ${PHP_OPCACHE_FILE_CACHE} \ + && chown -R www-data:www-data ${PHP_OPCACHE_FILE_CACHE} \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log @@ -202,13 +204,12 @@ ENV PHP_IDE_CONFIG="serverName=localhost" RUN apt-get update && \ apt-get -y install --no-install-suggests --no-install-recommends \ - make php${PHP_VERSION}-dev php-pear openssh-client git patch \ - && mkdir -p /tmp/pear/cache \ - && pecl channel-update pecl.php.net \ - && pecl install xdebug-${XDEBUG_VERSION} \ - && echo "zend_extension=xdebug.so" > /etc/php/${PHP_VERSION}/mods-available/xdebug.ini \ + make php${PHP_VERSION}-dev openssh-client git patch \ + && curl -L -sS https://github.com/php/pie/releases/download/${PHP_PIE_VERSION}/pie.phar -o /usr/local/bin/pie \ + && chmod +x /usr/local/bin/pie \ + && pie install xdebug/xdebug \ && phpenmod xdebug \ - && apt-get -y autoremove --purge make php${PHP_VERSION}-dev php-pear \ + && apt-get -y autoremove --purge make php${PHP_VERSION}-dev \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ && rm -rf /root/.pearrc \ @@ -219,6 +220,7 @@ RUN apt-get update && \ && rm -rf /usr/share/bug/file \ && rm -rf /usr/share/doc/file \ && rm -rf /var/lib/apt/lists/* /var/cache/ldconfig/aux-cache \ + && rm /usr/local/bin/pie \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log diff --git a/php/config/fpm-8.5/pool.d/.gitkeep b/php/config/fpm-8.5/pool.d/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/php/config/fpm-8.5/pool.d/access.conf b/php/config/fpm-8.5/pool.d/access.conf new file mode 100644 index 00000000..dabb62e9 --- /dev/null +++ b/php/config/fpm-8.5/pool.d/access.conf @@ -0,0 +1,3 @@ +[www] +access.suppress_path[] = /health +access.suppress_path[] = /status