From e08335e0b18749c9db85755b2e90278d43aafc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Thu, 18 May 2023 20:42:30 -0700 Subject: [PATCH] Upgrade Docker image to PHP 8.2 --- Dockerfile | 10 +++++----- app/Core/Thumbnail.php | 2 +- docker/etc/crontabs/nginx | 2 +- docker/etc/{php81 => php82}/conf.d/local.ini | 0 docker/etc/{php81 => php82}/php-fpm.conf | 2 +- docker/etc/{php81 => php82}/php-fpm.d/env.conf | 0 docker/etc/services.d/php/run | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) rename docker/etc/{php81 => php82}/conf.d/local.ini (100%) rename docker/etc/{php81 => php82}/php-fpm.conf (89%) rename docker/etc/{php81 => php82}/php-fpm.d/env.conf (100%) diff --git a/Dockerfile b/Dockerfile index 0aa96c646..26dd9ec93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,12 +17,12 @@ EXPOSE 80 443 ARG VERSION RUN apk --no-cache --update add \ - tzdata openssl unzip nginx bash ca-certificates s6 curl ssmtp mailx php81 php81-phar php81-curl \ - php81-fpm php81-json php81-zlib php81-xml php81-dom php81-ctype php81-opcache php81-zip php81-iconv \ - php81-pdo php81-pdo_mysql php81-pdo_sqlite php81-pdo_pgsql php81-mbstring php81-session php81-bcmath \ - php81-gd php81-openssl php81-sockets php81-posix php81-ldap php81-simplexml && \ + tzdata openssl unzip nginx bash ca-certificates s6 curl ssmtp mailx php82 php82-phar php82-curl \ + php82-fpm php82-json php82-zlib php82-xml php82-dom php82-ctype php82-opcache php82-zip php82-iconv \ + php82-pdo php82-pdo_mysql php82-pdo_sqlite php82-pdo_pgsql php82-mbstring php82-session php82-bcmath \ + php82-gd php82-openssl php82-sockets php82-posix php82-ldap php82-simplexml && \ rm -rf /var/www/localhost && \ - rm -f /etc/php81/php-fpm.d/www.conf + rm -f /etc/php82/php-fpm.d/www.conf ADD . /var/www/app ADD docker/ / diff --git a/app/Core/Thumbnail.php b/app/Core/Thumbnail.php index ba93747a1..d1c81c687 100644 --- a/app/Core/Thumbnail.php +++ b/app/Core/Thumbnail.php @@ -127,7 +127,7 @@ class Thumbnail imagealphablending($this->dstImage, false); imagesavealpha($this->dstImage, true); - imagecopyresampled($this->dstImage, $this->srcImage, $dstX, $dstY, 0, 0, $dstWidth, $dstHeight, $srcWidth, $srcHeight); + imagecopyresampled($this->dstImage, $this->srcImage, (int) $dstX, (int) $dstY, 0, 0, (int) $dstWidth, (int) $dstHeight, (int) $srcWidth, (int) $srcHeight); return $this; } diff --git a/docker/etc/crontabs/nginx b/docker/etc/crontabs/nginx index 9cc07adc7..816b406a4 100644 --- a/docker/etc/crontabs/nginx +++ b/docker/etc/crontabs/nginx @@ -1 +1 @@ -0 8 * * * cd /var/www/app && ./cli cronjob >/dev/null 2>&1 +0 8 * * * cd /var/www/app && php82 ./cli cronjob >/dev/null 2>&1 diff --git a/docker/etc/php81/conf.d/local.ini b/docker/etc/php82/conf.d/local.ini similarity index 100% rename from docker/etc/php81/conf.d/local.ini rename to docker/etc/php82/conf.d/local.ini diff --git a/docker/etc/php81/php-fpm.conf b/docker/etc/php82/php-fpm.conf similarity index 89% rename from docker/etc/php81/php-fpm.conf rename to docker/etc/php82/php-fpm.conf index edc022382..22bec3dac 100644 --- a/docker/etc/php81/php-fpm.conf +++ b/docker/etc/php82/php-fpm.conf @@ -16,4 +16,4 @@ pm.start_servers = 1 pm.min_spare_servers = 1 pm.max_spare_servers = 3 pm.max_requests = 2048 -include = /etc/php81/php-fpm.d/env.conf \ No newline at end of file +include = /etc/php82/php-fpm.d/env.conf \ No newline at end of file diff --git a/docker/etc/php81/php-fpm.d/env.conf b/docker/etc/php82/php-fpm.d/env.conf similarity index 100% rename from docker/etc/php81/php-fpm.d/env.conf rename to docker/etc/php82/php-fpm.d/env.conf diff --git a/docker/etc/services.d/php/run b/docker/etc/services.d/php/run index 171ad5fb0..ae79d7a95 100755 --- a/docker/etc/services.d/php/run +++ b/docker/etc/services.d/php/run @@ -1,2 +1,2 @@ #!/bin/execlineb -P -php-fpm81 -F \ No newline at end of file +php-fpm82 -F \ No newline at end of file