From 397b58a5bcc664406911f7de40d6b6ba74df21b1 Mon Sep 17 00:00:00 2001 From: Tim de Pater Date: Fri, 18 Aug 2023 21:03:50 +0200 Subject: [PATCH] Upgrade PHP to 8.2 --- Dockerfile | 36 ++++++++++++++++++------------------ README.md | 12 ++++++------ config/supervisord.conf | 2 +- run_tests.sh | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3eae7a88f..c9632b190 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG ALPINE_VERSION=3.18 FROM alpine:${ALPINE_VERSION} LABEL Maintainer="Tim de Pater " -LABEL Description="Lightweight container with Nginx 1.24 & PHP 8.1 based on Alpine Linux." +LABEL Description="Lightweight container with Nginx 1.24 & PHP 8.2 based on Alpine Linux." # Setup document root WORKDIR /var/www/html @@ -9,21 +9,21 @@ WORKDIR /var/www/html RUN apk add --no-cache \ curl \ nginx \ - php81 \ - php81-ctype \ - php81-curl \ - php81-dom \ - php81-fpm \ - php81-gd \ - php81-intl \ - php81-mbstring \ - php81-mysqli \ - php81-opcache \ - php81-openssl \ - php81-phar \ - php81-session \ - php81-xml \ - php81-xmlreader \ + php82 \ + php82-ctype \ + php82-curl \ + php82-dom \ + php82-fpm \ + php82-gd \ + php82-intl \ + php82-mbstring \ + php82-mysqli \ + php82-opcache \ + php82-openssl \ + php82-phar \ + php82-session \ + php82-xml \ + php82-xmlreader \ supervisor # Configure nginx - http @@ -32,8 +32,8 @@ COPY config/nginx.conf /etc/nginx/nginx.conf COPY config/conf.d /etc/nginx/conf.d/ # Configure PHP-FPM -COPY config/fpm-pool.conf /etc/php81/php-fpm.d/www.conf -COPY config/php.ini /etc/php81/conf.d/custom.ini +COPY config/fpm-pool.conf /etc/php82/php-fpm.d/www.conf +COPY config/php.ini /etc/php82/conf.d/custom.ini # Configure supervisord COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf diff --git a/README.md b/README.md index 29847b669..e8ed28254 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Docker PHP-FPM 8.1 & Nginx 1.24 on Alpine Linux -Example PHP-FPM 8.1 & Nginx 1.24 container image for Docker, built on [Alpine Linux](https://www.alpinelinux.org/). +# Docker PHP-FPM 8.2 & Nginx 1.24 on Alpine Linux +Example PHP-FPM 8.2 & Nginx 1.24 container image for Docker, built on [Alpine Linux](https://www.alpinelinux.org/). Repository: https://github.com/TrafeX/docker-php-nginx @@ -7,7 +7,7 @@ Repository: https://github.com/TrafeX/docker-php-nginx * Built on the lightweight and secure Alpine Linux distribution * Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64 * Very small Docker image size (+/-40MB) -* Uses PHP 8.1 for better performance, lower CPU usage & memory footprint +* Uses PHP 8.2 for the best performance, low CPU usage & memory footprint * Optimized for 100 concurrent users * Optimized to only use resources when there's traffic (by using PHP-FPM's `on-demand` process manager) * The services Nginx, PHP-FPM and supervisord run under a non-privileged user (nobody) to make it more secure @@ -15,8 +15,8 @@ Repository: https://github.com/TrafeX/docker-php-nginx * Follows the KISS principle (Keep It Simple, Stupid) to make it easy to understand and adjust the image to your needs [![Docker Pulls](https://img.shields.io/docker/pulls/trafex/php-nginx.svg)](https://hub.docker.com/r/trafex/php-nginx/) -![nginx 1.22](https://img.shields.io/badge/nginx-1.22-brightgreen.svg) -![php 8.1](https://img.shields.io/badge/php-8.1-brightgreen.svg) +![nginx 1.24](https://img.shields.io/badge/nginx-1.24-brightgreen.svg) +![php 8.2](https://img.shields.io/badge/php-8.2-brightgreen.svg) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg) ## [![Trafex Consultancy](https://timdepater.com/logo/mini-logo.png)](https://timdepater.com?mtm_campaign=github) @@ -55,7 +55,7 @@ Nginx configuration: PHP configuration: - docker run -v "`pwd`/php-setting.ini:/etc/php81/conf.d/settings.ini" trafex/php-nginx + docker run -v "`pwd`/php-setting.ini:/etc/php82/conf.d/settings.ini" trafex/php-nginx PHP-FPM configuration: diff --git a/config/supervisord.conf b/config/supervisord.conf index 77bda1a5b..584aed26b 100644 --- a/config/supervisord.conf +++ b/config/supervisord.conf @@ -5,7 +5,7 @@ logfile_maxbytes=0 pidfile=/run/supervisord.pid [program:php-fpm] -command=php-fpm81 -F +command=php-fpm82 -F stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/run_tests.sh b/run_tests.sh index 39689fe47..155fd0c56 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh apk --no-cache add curl -curl --silent --fail http://app:8080 | grep 'PHP 8.1' +curl --silent --fail http://app:8080 | grep 'PHP 8.2'