Skip to content

Commit 27cf98b

Browse files
committed
Upgrade Alpine Linux to 3.16, PHP to 8.1 and Nginx to 1.22
1 parent cc99d82 commit 27cf98b

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

Dockerfile

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
ARG ALPINE_VERSION=3.15
1+
ARG ALPINE_VERSION=3.16
22
FROM alpine:${ALPINE_VERSION}
33
LABEL Maintainer="Tim de Pater <[email protected]>"
4-
LABEL Description="Lightweight container with Nginx 1.20 & PHP 8.0 based on Alpine Linux."
4+
LABEL Description="Lightweight container with Nginx 1.22 & PHP 8.1 based on Alpine Linux."
55
# Setup document root
66
WORKDIR /var/www/html
77

88
# Install packages and remove default server definition
99
RUN apk add --no-cache \
1010
curl \
1111
nginx \
12-
php8 \
13-
php8-ctype \
14-
php8-curl \
15-
php8-dom \
16-
php8-fpm \
17-
php8-gd \
18-
php8-intl \
19-
php8-mbstring \
20-
php8-mysqli \
21-
php8-opcache \
22-
php8-openssl \
23-
php8-phar \
24-
php8-session \
25-
php8-xml \
26-
php8-xmlreader \
27-
php8-zlib \
12+
php81 \
13+
php81-ctype \
14+
php81-curl \
15+
php81-dom \
16+
php81-fpm \
17+
php81-gd \
18+
php81-intl \
19+
php81-mbstring \
20+
php81-mysqli \
21+
php81-opcache \
22+
php81-openssl \
23+
php81-phar \
24+
php81-session \
25+
php81-xml \
26+
php81-xmlreader \
27+
php81-zlib \
2828
supervisor
2929

3030
# Create symlink so programs depending on `php` still function
31-
RUN ln -s /usr/bin/php8 /usr/bin/php
31+
RUN ln -s /usr/bin/php81 /usr/bin/php
3232

3333
# Configure nginx
3434
COPY config/nginx.conf /etc/nginx/nginx.conf
3535

3636
# Configure PHP-FPM
37-
COPY config/fpm-pool.conf /etc/php8/php-fpm.d/www.conf
38-
COPY config/php.ini /etc/php8/conf.d/custom.ini
37+
COPY config/fpm-pool.conf /etc/php81/php-fpm.d/www.conf
38+
COPY config/php.ini /etc/php81/conf.d/custom.ini
3939

4040
# Configure supervisord
4141
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# Docker PHP-FPM 8.0 & Nginx 1.20 on Alpine Linux
2-
Example PHP-FPM 8.0 & Nginx 1.20 container image for Docker, built on [Alpine Linux](https://www.alpinelinux.org/).
1+
# Docker PHP-FPM 8.1 & Nginx 1.22 on Alpine Linux
2+
Example PHP-FPM 8.1 & Nginx 1.22 container image for Docker, built on [Alpine Linux](https://www.alpinelinux.org/).
33

44
Repository: https://github.com/TrafeX/docker-php-nginx
55

66

77
* Built on the lightweight and secure Alpine Linux distribution
88
* Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
99
* Very small Docker image size (+/-40MB)
10-
* Uses PHP 8.0 for better performance, lower CPU usage & memory footprint
10+
* Uses PHP 8.1 for better performance, lower CPU usage & memory footprint
1111
* Optimized for 100 concurrent users
1212
* Optimized to only use resources when there's traffic (by using PHP-FPM's `on-demand` process manager)
1313
* The services Nginx, PHP-FPM and supervisord run under a non-privileged user (nobody) to make it more secure
1414
* The logs of all the services are redirected to the output of the Docker container (visible with `docker logs -f <container name>`)
1515
* Follows the KISS principle (Keep It Simple, Stupid) to make it easy to understand and adjust the image to your needs
1616

1717
[![Docker Pulls](https://img.shields.io/docker/pulls/trafex/php-nginx.svg)](https://hub.docker.com/r/trafex/php-nginx/)
18-
![nginx 1.20](https://img.shields.io/badge/nginx-1.20-brightgreen.svg)
19-
![php 8.0](https://img.shields.io/badge/php-8.0-brightgreen.svg)
18+
![nginx 1.22](https://img.shields.io/badge/nginx-1.22-brightgreen.svg)
19+
![php 8.1](https://img.shields.io/badge/php-8.1-brightgreen.svg)
2020
![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)
2121

2222
## [![Trafex Consultancy](https://timdepater.com/logo/mini-logo.png)](https://timdepater.com?mtm_campaign=github)

config/supervisord.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ logfile_maxbytes=0
55
pidfile=/run/supervisord.pid
66

77
[program:php-fpm]
8-
command=php-fpm8 -F
8+
command=php-fpm81 -F
99
stdout_logfile=/dev/stdout
1010
stdout_logfile_maxbytes=0
1111
stderr_logfile=/dev/stderr

run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22
apk --no-cache add curl
3-
curl --silent --fail http://app:8080 | grep 'PHP 8.0'
3+
curl --silent --fail http://app:8080 | grep 'PHP 8.1'

0 commit comments

Comments
 (0)