From b211ecaa743d56ec960c12d6474b6790b1e58eb0 Mon Sep 17 00:00:00 2001 From: Ilmari Aho Date: Mon, 7 Oct 2024 12:59:12 +0300 Subject: [PATCH 1/2] feat(php83): update to php8.3 --- Dockerfile | 57 ++++++++++--------- rootfs/etc/cont-init.d/02-fix-perms.sh | 2 +- rootfs/etc/cont-init.d/03-config.sh | 12 ++-- rootfs/etc/cont-init.d/04-svc-main.sh | 4 +- .../etc/{php82 => php83}/conf.d/opcache.ini | 0 .../etc/{php82 => php83}/php-fpm.d/www.conf | 0 6 files changed, 38 insertions(+), 37 deletions(-) rename rootfs/tpls/etc/{php82 => php83}/conf.d/opcache.ini (100%) rename rootfs/tpls/etc/{php82 => php83}/php-fpm.d/www.conf (100%) diff --git a/Dockerfile b/Dockerfile index 09588090..494e4f02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,34 +35,34 @@ RUN apk --update --no-cache add \ openssl \ openssh-client \ perl \ - php82 \ - php82-cli \ - php82-ctype \ - php82-curl \ - php82-dom \ - php82-fileinfo \ - php82-fpm \ - php82-gd \ - php82-gmp \ - php82-json \ - php82-ldap \ - php82-mbstring \ - php82-mysqlnd \ - php82-opcache \ - php82-openssl \ - php82-pdo \ - php82-pdo_mysql \ - php82-pecl-memcached \ - php82-pear \ - php82-phar \ - php82-posix \ - php82-session \ - php82-simplexml \ - php82-snmp \ - php82-sockets \ - php82-tokenizer \ - php82-xml \ - php82-zip \ + php83 \ + php83-cli \ + php83-ctype \ + php83-curl \ + php83-dom \ + php83-fileinfo \ + php83-fpm \ + php83-gd \ + php83-gmp \ + php83-json \ + php83-ldap \ + php83-mbstring \ + php83-mysqlnd \ + php83-opcache \ + php83-openssl \ + php83-pdo \ + php83-pdo_mysql \ + php83-pecl-memcached \ + php83-pear \ + php83-phar \ + php83-posix \ + php83-session \ + php83-simplexml \ + php83-snmp \ + php83-sockets \ + php83-tokenizer \ + php83-xml \ + php83-zip \ python3 \ py3-pip \ rrdtool \ @@ -73,6 +73,7 @@ RUN apk --update --no-cache add \ tzdata \ util-linux \ whois \ + && ln -s /usr/bin/php83 /usr/bin/php \ && apk --update --no-cache add -t build-dependencies \ build-base \ make \ diff --git a/rootfs/etc/cont-init.d/02-fix-perms.sh b/rootfs/etc/cont-init.d/02-fix-perms.sh index 07858f2f..93203df1 100644 --- a/rootfs/etc/cont-init.d/02-fix-perms.sh +++ b/rootfs/etc/cont-init.d/02-fix-perms.sh @@ -17,6 +17,6 @@ chown -R librenms:librenms \ /tpls \ /var/lib/nginx \ /var/log/nginx \ - /var/log/php82 \ + /var/log/php83 \ /var/run/nginx \ /var/run/php-fpm diff --git a/rootfs/etc/cont-init.d/03-config.sh b/rootfs/etc/cont-init.d/03-config.sh index f6e1bf62..fdc48fca 100644 --- a/rootfs/etc/cont-init.d/03-config.sh +++ b/rootfs/etc/cont-init.d/03-config.sh @@ -64,17 +64,17 @@ sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \ -e "s/@FPM_PM_START_SERVERS@/$FPM_PM_START_SERVERS/g" \ -e "s/@FPM_PM_MIN_SPARE_SERVERS@/$FPM_PM_MIN_SPARE_SERVERS/g" \ -e "s/@FPM_PM_MAX_SPARE_SERVERS@/$FPM_PM_MAX_SPARE_SERVERS/g" \ - /tpls/etc/php82/php-fpm.d/www.conf >/etc/php82/php-fpm.d/www.conf + /tpls/etc/php83/php-fpm.d/www.conf >/etc/php83/php-fpm.d/www.conf echo "Setting PHP INI configuration..." -sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php82/php.ini -sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php82/php.ini -sed -i "s|;max_input_vars.*|max_input_vars = ${MAX_INPUT_VARS}|g" /etc/php82/php.ini +sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php83/php.ini +sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php83/php.ini +sed -i "s|;max_input_vars.*|max_input_vars = ${MAX_INPUT_VARS}|g" /etc/php83/php.ini # OpCache echo "Setting OpCache configuration..." sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \ - /tpls/etc/php82/conf.d/opcache.ini >/etc/php82/conf.d/opcache.ini + /tpls/etc/php83/conf.d/opcache.ini >/etc/php83/conf.d/opcache.ini # Nginx echo "Setting Nginx configuration..." @@ -256,4 +256,4 @@ for template in ${templates}; do fi echo " Adding ${template} alert template" ln -sf /data/alert-templates/${template} ${LIBRENMS_PATH}/resources/views/alerts/templates/${template} -done +done \ No newline at end of file diff --git a/rootfs/etc/cont-init.d/04-svc-main.sh b/rootfs/etc/cont-init.d/04-svc-main.sh index f81d8241..f03ca695 100644 --- a/rootfs/etc/cont-init.d/04-svc-main.sh +++ b/rootfs/etc/cont-init.d/04-svc-main.sh @@ -74,7 +74,7 @@ echo "Database ready!" counttables=$(echo 'SHOW TABLES' | ${dbcmd} "$DB_NAME" | wc -l) if [ "${counttables}" -eq "0" ]; then echo "Enabling First Run Wizard..." - echo "INSTALL=user,finish">> ${LIBRENMS_PATH}/.env + echo "INSTALL=user,finish" >>${LIBRENMS_PATH}/.env fi echo "Updating database schema..." @@ -99,7 +99,7 @@ cat >/etc/services.d/php-fpm/run < Date: Mon, 7 Oct 2024 13:29:06 +0300 Subject: [PATCH 2/2] feat(php83): fix nit --- rootfs/etc/cont-init.d/03-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/cont-init.d/03-config.sh b/rootfs/etc/cont-init.d/03-config.sh index fdc48fca..b8689452 100644 --- a/rootfs/etc/cont-init.d/03-config.sh +++ b/rootfs/etc/cont-init.d/03-config.sh @@ -256,4 +256,4 @@ for template in ${templates}; do fi echo " Adding ${template} alert template" ln -sf /data/alert-templates/${template} ${LIBRENMS_PATH}/resources/views/alerts/templates/${template} -done \ No newline at end of file +done