mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-21 15:53:13 +01:00
Drop PHP8.1 support
This commit is contained in:
parent
f7be650b3f
commit
243313bda0
@ -6,7 +6,6 @@ env:
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 8.1
|
||||
- 8.2
|
||||
- 8.3
|
||||
|
||||
|
30
Dockerfile
vendored
30
Dockerfile
vendored
@ -1,8 +1,8 @@
|
||||
ARG BUILDPLATFORM=linux/amd64
|
||||
ARG TARGETPLATFORM
|
||||
ARG ALPINE_VERSION=3.17
|
||||
ARG PHP_VERSION=8.1-alpine${ALPINE_VERSION}
|
||||
ARG COMPOSER_VERSION=2.3
|
||||
ARG ALPINE_VERSION=3.19
|
||||
ARG PHP_VERSION=8.2-alpine${ALPINE_VERSION}
|
||||
ARG COMPOSER_VERSION=2.7
|
||||
ARG SUPERVISORD_VERSION=v0.7.3
|
||||
|
||||
ARG UID=1000
|
||||
@ -46,28 +46,28 @@ COPY --from=supervisord --chown=${UID}:${GID} /bin /usr/local/bin/supervisord
|
||||
# Install PHP and PHP system dependencies
|
||||
RUN apk add --update --no-cache \
|
||||
# PHP
|
||||
php81 \
|
||||
php82 \
|
||||
# Composer dependencies
|
||||
php81-phar \
|
||||
php82-phar \
|
||||
# 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
|
||||
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
|
||||
php81-session php81-openssl \
|
||||
php82-session php82-openssl \
|
||||
# Nginx and PHP FPM to serve over HTTP
|
||||
php81-fpm nginx
|
||||
php82-fpm nginx
|
||||
|
||||
# PHP FPM configuration
|
||||
# Change username and ownership in php-fpm pool config
|
||||
RUN sed -i '/user = nobody/d' /etc/php81/php-fpm.d/www.conf && \
|
||||
sed -i '/group = nobody/d' /etc/php81/php-fpm.d/www.conf && \
|
||||
sed -i '/listen.owner/d' /etc/php81/php-fpm.d/www.conf && \
|
||||
sed -i '/listen.group/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/php82/php-fpm.d/www.conf && \
|
||||
sed -i '/listen.owner/d' /etc/php82/php-fpm.d/www.conf && \
|
||||
sed -i '/listen.group/d' /etc/php82/php-fpm.d/www.conf
|
||||
# Pre-create files with the correct permissions
|
||||
RUN mkdir /run/php && \
|
||||
chown ${UID}:${GID} /run/php /var/log/php81 && \
|
||||
chmod 700 /run/php /var/log/php81
|
||||
chown ${UID}:${GID} /run/php /var/log/php82 && \
|
||||
chmod 700 /run/php /var/log/php82
|
||||
|
||||
# NGINX
|
||||
# Clean up
|
||||
|
@ -60,7 +60,7 @@ ### RFC compliance
|
||||
|
||||
## 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)
|
||||
* Any database [supported by Laravel](https://laravel.com/docs/7.x/database)
|
||||
|
||||
|
@ -102,8 +102,8 @@ ### 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` | `8.1-buster` | The PHP version to use to get composer dependencies |
|
||||
| `COMPOSER_VERSION` | `2.3` | The version of composer to use |
|
||||
| `PHP_VERSION` | `8.2-buster` | The PHP version to use to get composer dependencies |
|
||||
| `COMPOSER_VERSION` | `2.7` | 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 |
|
||||
|
2
docker/entrypoint.sh
vendored
2
docker/entrypoint.sh
vendored
@ -6,7 +6,7 @@ echo "Running version ${VERSION} commit ${COMMIT} built on ${CREATED}"
|
||||
|
||||
# Show versions
|
||||
echo "supervisord version: $(supervisord version)"
|
||||
php-fpm81 -v | head -n 1
|
||||
php-fpm82 -v | head -n 1
|
||||
nginx -v
|
||||
|
||||
# Database creation
|
||||
|
@ -12,7 +12,7 @@ autorestart=false
|
||||
startretries=0
|
||||
|
||||
[program:php-fpm]
|
||||
command=/usr/sbin/php-fpm81 -F
|
||||
command=/usr/sbin/php-fpm82 -F
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx -g 'daemon off;'
|
||||
|
@ -4,7 +4,7 @@ # Debian Setup
|
||||
|
||||
## 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 setup to use an Sqlite database
|
||||
- We will use Nginx and PHP-FPM to serve our site on port `8000`
|
||||
@ -22,11 +22,11 @@ ## Install dependencies
|
||||
|
||||
```bash
|
||||
apt-get install -y --no-install-recommends \
|
||||
php8.1 \
|
||||
php8.1-sqlite3 php8.1-mysql \
|
||||
php-xml php8.1-gd php8.1-mbstring \
|
||||
php8.2 \
|
||||
php8.2-sqlite3 php8.2-mysql \
|
||||
php-xml php8.2-gd php8.2-mbstring \
|
||||
unzip wget ca-certificates \
|
||||
php8.1-fpm nginx
|
||||
php8.2-fpm nginx
|
||||
```
|
||||
|
||||
## Download the code
|
||||
@ -71,7 +71,7 @@ ## Nginx configuration
|
||||
error_page 404 /index.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;
|
||||
include fastcgi_params;
|
||||
}
|
||||
@ -129,7 +129,7 @@ ## Install supervisord
|
||||
startretries=0
|
||||
|
||||
[program:php-fpm]
|
||||
command=/usr/sbin/php-fpm8.1 -F
|
||||
command=/usr/sbin/php-fpm8.2 -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/php8.1-fpm.log
|
||||
touch /run/nginx.pid /var/log/php8.2-fpm.log
|
||||
chown -R www-data \
|
||||
/var/log/php8.1-fpm.log \
|
||||
/var/log/php8.2-fpm.log \
|
||||
/run/nginx.pid \
|
||||
/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
|
||||
|
Loading…
Reference in New Issue
Block a user