Drop PHP8.1 support

This commit is contained in:
Bubka 2024-05-15 09:10:47 +02:00
parent f7be650b3f
commit 243313bda0
7 changed files with 30 additions and 31 deletions

View File

@ -6,7 +6,6 @@ env:
language: php language: php
php: php:
- 8.1
- 8.2 - 8.2
- 8.3 - 8.3

30
Dockerfile vendored
View File

@ -1,8 +1,8 @@
ARG BUILDPLATFORM=linux/amd64 ARG BUILDPLATFORM=linux/amd64
ARG TARGETPLATFORM ARG TARGETPLATFORM
ARG ALPINE_VERSION=3.17 ARG ALPINE_VERSION=3.19
ARG PHP_VERSION=8.1-alpine${ALPINE_VERSION} ARG PHP_VERSION=8.2-alpine${ALPINE_VERSION}
ARG COMPOSER_VERSION=2.3 ARG COMPOSER_VERSION=2.7
ARG SUPERVISORD_VERSION=v0.7.3 ARG SUPERVISORD_VERSION=v0.7.3
ARG UID=1000 ARG UID=1000
@ -46,28 +46,28 @@ COPY --from=supervisord --chown=${UID}:${GID} /bin /usr/local/bin/supervisord
# Install PHP and PHP system dependencies # Install PHP and PHP system dependencies
RUN apk add --update --no-cache \ RUN apk add --update --no-cache \
# PHP # PHP
php81 \ php82 \
# Composer dependencies # Composer dependencies
php81-phar \ php82-phar \
# PHP SQLite, MySQL/MariaDB & Postgres drivers # PHP SQLite, MySQL/MariaDB & Postgres drivers
php81-pdo_sqlite php81-sqlite3 php81-pdo_mysql php81-pdo_pgsql php81-pgsql \ php82-pdo_sqlite php82-sqlite3 php82-pdo_mysql php82-pdo_pgsql php82-pgsql \
# PHP extensions # PHP extensions
php81-xml php81-gd php81-mbstring php81-tokenizer php81-fileinfo php81-bcmath php81-ctype php81-dom \ php82-xml php82-gd php82-mbstring php82-tokenizer php82-fileinfo php82-bcmath php82-ctype php82-dom \
# Runtime dependencies # Runtime dependencies
php81-session php81-openssl \ php82-session php82-openssl \
# Nginx and PHP FPM to serve over HTTP # Nginx and PHP FPM to serve over HTTP
php81-fpm nginx php82-fpm nginx
# PHP FPM configuration # PHP FPM configuration
# Change username and ownership in php-fpm pool config # Change username and ownership in php-fpm pool config
RUN sed -i '/user = nobody/d' /etc/php81/php-fpm.d/www.conf && \ RUN sed -i '/user = nobody/d' /etc/php82/php-fpm.d/www.conf && \
sed -i '/group = nobody/d' /etc/php81/php-fpm.d/www.conf && \ sed -i '/group = nobody/d' /etc/php82/php-fpm.d/www.conf && \
sed -i '/listen.owner/d' /etc/php81/php-fpm.d/www.conf && \ sed -i '/listen.owner/d' /etc/php82/php-fpm.d/www.conf && \
sed -i '/listen.group/d' /etc/php81/php-fpm.d/www.conf sed -i '/listen.group/d' /etc/php82/php-fpm.d/www.conf
# Pre-create files with the correct permissions # Pre-create files with the correct permissions
RUN mkdir /run/php && \ RUN mkdir /run/php && \
chown ${UID}:${GID} /run/php /var/log/php81 && \ chown ${UID}:${GID} /run/php /var/log/php82 && \
chmod 700 /run/php /var/log/php81 chmod 700 /run/php /var/log/php82
# NGINX # NGINX
# Clean up # Clean up

View File

@ -60,7 +60,7 @@ ### RFC compliance
## Requirements ## Requirements
* [![Requires PHP8](https://img.shields.io/badge/php-^8.1-red.svg?style=flat-square)](https://secure.php.net/downloads.php) * [![Requires PHP8](https://img.shields.io/badge/php-^8.2-red.svg?style=flat-square)](https://secure.php.net/downloads.php)
* See [Laravel server requirements](https://laravel.com/docs/7.x/installation#server-requirements) * See [Laravel server requirements](https://laravel.com/docs/7.x/installation#server-requirements)
* Any database [supported by Laravel](https://laravel.com/docs/7.x/database) * Any database [supported by Laravel](https://laravel.com/docs/7.x/database)

View File

@ -102,8 +102,8 @@ ### Build the image with build arguments
| `UID` | 1000 | The UID of the user to run the container as | | `UID` | 1000 | The UID of the user to run the container as |
| `GID` | 1000 | The GID of the user to run the container as | | `GID` | 1000 | The GID of the user to run the container as |
| `DEBIAN_VERSION` | `buster-slim` | The Debian version to use | | `DEBIAN_VERSION` | `buster-slim` | The Debian version to use |
| `PHP_VERSION` | `8.1-buster` | The PHP version to use to get composer dependencies | | `PHP_VERSION` | `8.2-buster` | The PHP version to use to get composer dependencies |
| `COMPOSER_VERSION` | `2.3` | The version of composer to use | | `COMPOSER_VERSION` | `2.7` | The version of composer to use |
| `SUPERVISORD_VERSION` | `v0.7.3` | The version of supervisord to use | | `SUPERVISORD_VERSION` | `v0.7.3` | The version of supervisord to use |
| `VERSION` | `unknown` | The version of the image | | `VERSION` | `unknown` | The version of the image |
| `CREATED` | `an unknown date` | The date of the image build time | | `CREATED` | `an unknown date` | The date of the image build time |

View File

@ -6,7 +6,7 @@ echo "Running version ${VERSION} commit ${COMMIT} built on ${CREATED}"
# Show versions # Show versions
echo "supervisord version: $(supervisord version)" echo "supervisord version: $(supervisord version)"
php-fpm81 -v | head -n 1 php-fpm82 -v | head -n 1
nginx -v nginx -v
# Database creation # Database creation

View File

@ -12,7 +12,7 @@ autorestart=false
startretries=0 startretries=0
[program:php-fpm] [program:php-fpm]
command=/usr/sbin/php-fpm81 -F command=/usr/sbin/php-fpm82 -F
[program:nginx] [program:nginx]
command=/usr/sbin/nginx -g 'daemon off;' command=/usr/sbin/nginx -g 'daemon off;'

View File

@ -4,7 +4,7 @@ # Debian Setup
## What we will do ## What we will do
- We will use PHP 8.1 - We will use PHP 8.2
- We will use version v4.0.0 of 2fauth - We will use version v4.0.0 of 2fauth
- We will setup to use an Sqlite database - We will setup to use an Sqlite database
- We will use Nginx and PHP-FPM to serve our site on port `8000` - We will use Nginx and PHP-FPM to serve our site on port `8000`
@ -22,11 +22,11 @@ ## Install dependencies
```bash ```bash
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
php8.1 \ php8.2 \
php8.1-sqlite3 php8.1-mysql \ php8.2-sqlite3 php8.2-mysql \
php-xml php8.1-gd php8.1-mbstring \ php-xml php8.2-gd php8.2-mbstring \
unzip wget ca-certificates \ unzip wget ca-certificates \
php8.1-fpm nginx php8.2-fpm nginx
``` ```
## Download the code ## Download the code
@ -71,7 +71,7 @@ ## Nginx configuration
error_page 404 /index.php; error_page 404 /index.php;
location ~ \.php$ { location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;
} }
@ -129,7 +129,7 @@ ## Install supervisord
startretries=0 startretries=0
[program:php-fpm] [program:php-fpm]
command=/usr/sbin/php-fpm8.1 -F command=/usr/sbin/php-fpm8.2 -F
[program:nginx] [program:nginx]
command=/usr/sbin/nginx -g 'daemon off;' command=/usr/sbin/nginx -g 'daemon off;'
@ -155,14 +155,14 @@ ## Fix ownership and permissions for `www-data`
```bash ```bash
mkdir -p /run/php /www/data/.composer mkdir -p /run/php /www/data/.composer
touch /run/nginx.pid /var/log/php8.1-fpm.log touch /run/nginx.pid /var/log/php8.2-fpm.log
chown -R www-data \ chown -R www-data \
/var/log/php8.1-fpm.log \ /var/log/php8.2-fpm.log \
/run/nginx.pid \ /run/nginx.pid \
/run/php \ /run/php \
/www/data/.composer /www/data/.composer
chmod 700 /run/php /www/data/.composer chmod 700 /run/php /www/data/.composer
chmod 600 /var/log/php8.1-fpm.log chmod 600 /var/log/php8.2-fpm.log
``` ```
## Change user ## Change user