Drop PHP 7.4 support, default to PHP8.0

This commit is contained in:
Bubka 2022-07-22 16:28:11 +02:00
parent c25aaa3371
commit 2066ef93f9
6 changed files with 25 additions and 26 deletions

View File

@ -6,7 +6,6 @@ env:
language: php
php:
- 7.4
- 8.0
- 8.1

View File

@ -1,8 +1,8 @@
ARG BUILDPLATFORM=linux/amd64
ARG TARGETPLATFORM
ARG ALPINE_VERSION=3.14
ARG PHP_VERSION=7.4-alpine${ALPINE_VERSION}
ARG COMPOSER_VERSION=2.1
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.1-alpine${ALPINE_VERSION}
ARG COMPOSER_VERSION=2.3
ARG SUPERVISORD_VERSION=v0.7.3
ARG UID=1000

View File

@ -60,7 +60,7 @@ ### RFC compliance
## Requirements
* [![Requires PHP7](https://img.shields.io/badge/php-7.4.*-red.svg?style=flat-square)](https://secure.php.net/downloads.php)
* [![Requires PHP8](https://img.shields.io/badge/php-^8.0-red.svg?style=flat-square)](https://secure.php.net/downloads.php)
* 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)

View File

@ -8,7 +8,7 @@
],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"php": "^8.0.2",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-dom": "*",
@ -23,7 +23,7 @@
"chillerlan/php-qrcode": "^4.3",
"darkghosthunter/larapass": "^3.0.2",
"doctormckay/steam-totp": "^1.0",
"doctrine/dbal": "^3.2",
"doctrine/dbal": "^3.3",
"fruitcake/laravel-cors": "^2.0",
"google/protobuf": "^3.21",
"guzzlehttp/guzzle": "^7.0.1",
@ -32,14 +32,14 @@
"laravel/passport": "^10.0",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"paragonie/constant_time_encoding": "^2.4",
"spatie/eloquent-sortable": "^3.11",
"paragonie/constant_time_encoding": "^2.6",
"spatie/eloquent-sortable": "^4.0.1",
"spomky-labs/otphp": "^10.0"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"fakerphp/faker": "^1.16",
"mockery/mockery": "^1.3",
"fakerphp/faker": "^1.20",
"mockery/mockery": "^1.5",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.5"
},

View File

@ -102,14 +102,14 @@ ### Build the image with build arguments
| `UID` | 1000 | The UID 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 |
| `PHP_VERSION` | `7.4-buster` | The PHP version to use to get composer dependencies |
| `COMPOSER_VERSION` | `2.1` | The version of composer to use |
| `PHP_VERSION` | `8.1-buster` | The PHP version to use to get composer dependencies |
| `COMPOSER_VERSION` | `2.3` | The version of composer to use |
| `SUPERVISORD_VERSION` | `v0.7.3` | The version of supervisord to use |
| `VERSION` | `unknown` | The version of the image |
| `CREATED` | `an unknown date` | The date of the image build time |
| `COMMIT` | `unknown` | The commit hash of the Git commit used |
### Mail settings ####
#### Mail settings
| Build argument | Default | Description |
| --- | --- | --- |
@ -121,7 +121,7 @@ ### Mail settings ####
Example:
```
```text
...
-e MAIL_HOST=smtp.example.com
-e MAIL_PORT=587

View File

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