mirror of
https://github.com/netfun2000/docker-php-nginx.git
synced 2026-08-13 01:59:29 +08:00
Update to PHP 8.4
This commit is contained in:
committed by
Tim de Pater
parent
43aa4be9b7
commit
7be04d94a2
+21
-21
@@ -1,7 +1,7 @@
|
|||||||
ARG ALPINE_VERSION=3.20
|
ARG ALPINE_VERSION=3.21
|
||||||
FROM alpine:${ALPINE_VERSION}
|
FROM alpine:${ALPINE_VERSION}
|
||||||
LABEL Maintainer="Tim de Pater <code@trafex.nl>"
|
LABEL Maintainer="Tim de Pater <code@trafex.nl>"
|
||||||
LABEL Description="Lightweight container with Nginx 1.26 & PHP 8.3 based on Alpine Linux."
|
LABEL Description="Lightweight container with Nginx 1.26 & PHP 8.4 based on Alpine Linux."
|
||||||
# Setup document root
|
# Setup document root
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
@@ -9,24 +9,24 @@ WORKDIR /var/www/html
|
|||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
curl \
|
curl \
|
||||||
nginx \
|
nginx \
|
||||||
php83 \
|
php84 \
|
||||||
php83-ctype \
|
php84-ctype \
|
||||||
php83-curl \
|
php84-curl \
|
||||||
php83-dom \
|
php84-dom \
|
||||||
php83-fileinfo \
|
php84-fileinfo \
|
||||||
php83-fpm \
|
php84-fpm \
|
||||||
php83-gd \
|
php84-gd \
|
||||||
php83-intl \
|
php84-intl \
|
||||||
php83-mbstring \
|
php84-mbstring \
|
||||||
php83-mysqli \
|
php84-mysqli \
|
||||||
php83-opcache \
|
php84-opcache \
|
||||||
php83-openssl \
|
php84-openssl \
|
||||||
php83-phar \
|
php84-phar \
|
||||||
php83-session \
|
php84-session \
|
||||||
php83-tokenizer \
|
php84-tokenizer \
|
||||||
php83-xml \
|
php84-xml \
|
||||||
php83-xmlreader \
|
php84-xmlreader \
|
||||||
php83-xmlwriter \
|
php84-xmlwriter \
|
||||||
supervisor
|
supervisor
|
||||||
|
|
||||||
# Configure nginx - http
|
# Configure nginx - http
|
||||||
@@ -35,7 +35,7 @@ COPY config/nginx.conf /etc/nginx/nginx.conf
|
|||||||
COPY config/conf.d /etc/nginx/conf.d/
|
COPY config/conf.d /etc/nginx/conf.d/
|
||||||
|
|
||||||
# Configure PHP-FPM
|
# Configure PHP-FPM
|
||||||
ENV PHP_INI_DIR /etc/php83
|
ENV PHP_INI_DIR /etc/php84
|
||||||
COPY config/fpm-pool.conf ${PHP_INI_DIR}/php-fpm.d/www.conf
|
COPY config/fpm-pool.conf ${PHP_INI_DIR}/php-fpm.d/www.conf
|
||||||
COPY config/php.ini ${PHP_INI_DIR}/conf.d/custom.ini
|
COPY config/php.ini ${PHP_INI_DIR}/conf.d/custom.ini
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Docker PHP-FPM 8.3 & Nginx 1.26 on Alpine Linux
|
# Docker PHP-FPM 8.4 & Nginx 1.26 on Alpine Linux
|
||||||
Example PHP-FPM 8.3 & Nginx 1.26 container image for Docker, built on [Alpine Linux](https://www.alpinelinux.org/).
|
Example PHP-FPM 8.4 & Nginx 1.26 container image for Docker, built on [Alpine Linux](https://www.alpinelinux.org/).
|
||||||
|
|
||||||
Repository: https://github.com/TrafeX/docker-php-nginx
|
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
|
* Built on the lightweight and secure Alpine Linux distribution
|
||||||
* Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
|
* Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
|
||||||
* Very small Docker image size (+/-40MB)
|
* Very small Docker image size (+/-40MB)
|
||||||
* Uses PHP 8.3 for the best performance, low CPU usage & memory footprint
|
* Uses PHP 8.4 for the best performance, low CPU usage & memory footprint
|
||||||
* Optimized for 100 concurrent users
|
* Optimized for 100 concurrent users
|
||||||
* Optimized to only use resources when there's traffic (by using PHP-FPM's `on-demand` process manager)
|
* 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
|
* The services Nginx, PHP-FPM and supervisord run under a non-privileged user (nobody) to make it more secure
|
||||||
@@ -16,7 +16,7 @@ Repository: https://github.com/TrafeX/docker-php-nginx
|
|||||||
|
|
||||||
[](https://hub.docker.com/r/trafex/php-nginx/)
|
[](https://hub.docker.com/r/trafex/php-nginx/)
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## [](https://timdepater.com?mtm_campaign=github)
|
## [](https://timdepater.com?mtm_campaign=github)
|
||||||
@@ -53,11 +53,11 @@ Nginx configuration:
|
|||||||
|
|
||||||
PHP configuration:
|
PHP configuration:
|
||||||
|
|
||||||
docker run -v "`pwd`/php-setting.ini:/etc/php83/conf.d/settings.ini" trafex/php-nginx
|
docker run -v "`pwd`/php-setting.ini:/etc/php84/conf.d/settings.ini" trafex/php-nginx
|
||||||
|
|
||||||
PHP-FPM configuration:
|
PHP-FPM configuration:
|
||||||
|
|
||||||
docker run -v "`pwd`/php-fpm-settings.conf:/etc/php83/php-fpm.d/server.conf" trafex/php-nginx
|
docker run -v "`pwd`/php-fpm-settings.conf:/etc/php84/php-fpm.d/server.conf" trafex/php-nginx
|
||||||
|
|
||||||
_Note; Because `-v` requires an absolute path I've added `pwd` in the example to return the absolute path to the current directory_
|
_Note; Because `-v` requires an absolute path I've added `pwd` in the example to return the absolute path to the current directory_
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ logfile_maxbytes=0
|
|||||||
pidfile=/run/supervisord.pid
|
pidfile=/run/supervisord.pid
|
||||||
|
|
||||||
[program:php-fpm]
|
[program:php-fpm]
|
||||||
command=php-fpm83 -F
|
command=php-fpm84 -F
|
||||||
stdout_logfile=/dev/stdout
|
stdout_logfile=/dev/stdout
|
||||||
stdout_logfile_maxbytes=0
|
stdout_logfile_maxbytes=0
|
||||||
stderr_logfile=/dev/stderr
|
stderr_logfile=/dev/stderr
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ FROM trafex/php-nginx:latest
|
|||||||
USER root
|
USER root
|
||||||
|
|
||||||
# Install xdebug
|
# Install xdebug
|
||||||
RUN apk add --no-cache php83-pecl-xdebug
|
RUN apk add --no-cache php84-pecl-xdebug
|
||||||
|
|
||||||
# Add configuration
|
# Add configuration
|
||||||
COPY xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini
|
COPY xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
apk --no-cache add curl
|
apk --no-cache add curl
|
||||||
curl --silent --fail http://app:8080 | grep 'PHP 8.3'
|
curl --silent --fail http://app:8080 | grep 'PHP 8.4'
|
||||||
|
|||||||
Reference in New Issue
Block a user