Skip to content

Commit

Permalink
v7.1.0 (#191)
Browse files Browse the repository at this point in the history
Major updates
* Adding support for PHP 8.3

Minor updates
* Using latest base images
* Don't use custom session / upload paths

Documentation updates
* Adding sample www-conf.json file
* Improving documentation to reflect v7.x changes

Development updates
* Making PHP 8.3 the default in run.sh
  • Loading branch information
bfren authored Dec 9, 2023
1 parent 53851dd commit f83166b
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ "7.4", "8.0", "8.1", "8.2" ]
php: [ "7.4", "8.0", "8.1", "8.2", "8.3" ]
runs-on: ubuntu-latest
steps:
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ "7.4", "8.0", "8.1", "8.2" ]
php: [ "7.4", "8.0", "8.1", "8.2", "8.3" ]
runs-on: ubuntu-latest
steps:
-
Expand Down
4 changes: 2 additions & 2 deletions 7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /tmp
RUN \
# get the Nu scripts from the PHP image overlay
echo "Cloning Alpine overlay." && \
apk add git && git clone --branch v2.0.4 https://github.com/bfren/docker-php.git && \
apk add git && git clone --branch v2.1.0 https://github.com/bfren/docker-php.git && \
mkdir /overlay && \
mv docker-php/overlay/etc /overlay/

Expand All @@ -17,7 +17,7 @@ RUN \
# STAGE 1: create final image
#======================================================================================================================

FROM bfren/nginx:nginx1.20-alpine3.15-6.0.4 as final
FROM bfren/nginx:nginx1.20-alpine3.15-6.1.0 as final
COPY --from=php /overlay /

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-nginx-php"
Expand Down
4 changes: 2 additions & 2 deletions 8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /tmp
RUN \
# get the Nu scripts from the PHP image overlay
echo "Cloning Alpine overlay." && \
apk add git && git clone --branch v2.0.4 https://github.com/bfren/docker-php.git && \
apk add git && git clone --branch v2.1.0 https://github.com/bfren/docker-php.git && \
mkdir /overlay && \
mv docker-php/overlay/etc /overlay/

Expand All @@ -17,7 +17,7 @@ RUN \
# STAGE 1: create final image
#======================================================================================================================

FROM bfren/nginx:nginx1.22-alpine3.16-6.0.4 as final
FROM bfren/nginx:nginx1.22-alpine3.16-6.1.0 as final
COPY --from=php /overlay /

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-nginx-php"
Expand Down
4 changes: 2 additions & 2 deletions 8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /tmp
RUN \
# get the Nu scripts from the PHP image overlay
echo "Cloning Alpine overlay." && \
apk add git && git clone --branch v2.0.4 https://github.com/bfren/docker-php.git && \
apk add git && git clone --branch v2.1.0 https://github.com/bfren/docker-php.git && \
mkdir /overlay && \
mv docker-php/overlay/etc /overlay/

Expand All @@ -17,7 +17,7 @@ RUN \
# STAGE 1: create final image
#======================================================================================================================

FROM bfren/nginx:nginx1.24-alpine3.18-6.0.4 as final
FROM bfren/nginx:nginx1.24-alpine3.18-6.1.0 as final
COPY --from=php /overlay /

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-nginx-php"
Expand Down
4 changes: 2 additions & 2 deletions 8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /tmp
RUN \
# get the Nu scripts from the PHP image overlay
echo "Cloning Alpine overlay." && \
apk add git && git clone --branch v2.0.4 https://github.com/bfren/docker-php.git && \
apk add git && git clone --branch v2.1.0 https://github.com/bfren/docker-php.git && \
mkdir /overlay && \
mv docker-php/overlay/etc /overlay/

Expand All @@ -17,7 +17,7 @@ RUN \
# STAGE 1: create final image
#======================================================================================================================

FROM bfren/nginx:nginx1.24-alpine3.18-6.0.4 as final
FROM bfren/nginx:nginx1.24-alpine3.18-6.1.0 as final
COPY --from=php /overlay /

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-nginx-php"
Expand Down
41 changes: 41 additions & 0 deletions 8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#======================================================================================================================
# STAGE 0: get Nu scripts from the PHP image overlay
#======================================================================================================================

FROM alpine AS php

WORKDIR /tmp
RUN \
# get the Nu scripts from the PHP image overlay
echo "Cloning Alpine overlay." && \
apk add git && git clone --branch v2.1.0 https://github.com/bfren/docker-php.git && \
mkdir /overlay && \
mv docker-php/overlay/etc /overlay/


#======================================================================================================================
# STAGE 1: create final image
#======================================================================================================================

FROM bfren/nginx:nginx1.24-alpine3.19-6.1.0 as final
COPY --from=php /overlay /

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-nginx-php"

ARG BF_IMAGE
ARG BF_VERSION

COPY ./overlay /
COPY ./8.3/overlay /

ENV \
# PHP config directory
BF_PHP_DIR="/etc/php83" \
# offical php.ini template to download
BF_PHP_ENV="production" \
# space-separated extensions to install on startup
BF_PHP_EXT= \
# PHP package prefix
BF_PHP_PREFIX="php83"

RUN bf-install
1 change: 1 addition & 0 deletions 8.3/NGINX_BASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nginx1.24-alpine3.19
1 change: 1 addition & 0 deletions 8.3/PHP_PREFIX
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
php83
1 change: 1 addition & 0 deletions 8.3/overlay/tmp/PHP_BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.3.0-r0
1 change: 1 addition & 0 deletions 8.3/overlay/tmp/PHP_REVISION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.3.0
38 changes: 3 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@

[Docker Repository](https://hub.docker.com/r/bfren/nginx-php) - [bfren ecosystem](https://github.com/bfren/docker)

Nginx plus PHP (7.4, 8.0, 8.1 and 8.2) - no SSL support etc, designed to be used behind a proxy server. Minimal PHP packages are installed:
Nginx plus PHP (7.4, 8.0, 8.1, 8.2 and 8.3) - no SSL support etc, designed to be used behind a proxy server. Minimal PHP packages are installed:

* `php`
* `php-common`
* `php-fpm`
* `php-session`

Nginx is setup by default to run PHP in FPM mode.

Additionally, `bash` is installed as it is required by some of the setup scripts.
Nginx is setup by default to run PHP in FPM mode. To override values in www.conf map a `www-conf.json` file to root - see `www-conf-sample.json`. Values in the php.ini file can be overridden in the same way - see [Docker PHP](https://github.com/bfren/docker-php) for more information and a sample file.

## Contents

* [Ports](#ports)
* [Volumes](#volumes)
* [Environment Variables](#environment-variables)
* [Helper Functions](#helper-functions)
* [Nginx Configuration Helpers](#nginx-configuration-helpers)
* [Licence / Copyright](#licence)

Expand All @@ -36,36 +33,7 @@ Additionally, `bash` is installed as it is required by some of the setup scripts

## Environment Variables

### php.ini

| Variable | Values | Description | Default |
| --------- | ----------------------------- | ------------------------------------------------------------------------------ | ------------ |
| `PHP_INI` | 'production' or 'development' | Defines which official php.ini template to use, "production" or "development". | 'production' |

The following environment variables will override values in `php.ini` (see [here](https://www.php.net/manual/en/ini.list.php)):

| Variable | Directive | Default Value |
| -------------------------------- | ---------------------- | ------------- |
| `PHP_INI_DISPLAY_ERRORS` | display_errors | *None* |
| `PHP_INI_DISPLAY_STARTUP_ERRORS` | display_startup_errors | *None* |
| `PHP_INI_ERROR_REPORTING` | error_reporting | *None* |
| `PHP_INI_MEMORY_LIMIT` | memory_limit | 256M |
| `PHP_INI_MAX_UPLOAD` | upload_max_filesize | 64M |
| `PHP_INI_MAX_POST` | post_max_size | 64M |

### FPM Configuration

The following environment variables will override values in `php-fpm.d/www.conf` (see [here](https://www.php.net/manual/en/install.fpm.configuration.php)):

| Variable | Directive | Default Value |
| ------------------- | --------- | ------------- |
| `PHP_FPM_LOG_LEVEL` | log_level | 'notice' |

## Helper Functions

| Function | Arguments | Description |
| -------------------- | --------- | ----------------------------------------------------------- |
| `php-clean-sessions` | *None* | Cleans PHP session information - the cron runs this hourly. |
See [Docker PHP](https://github.com/bfren/docker-php) for configuration instructions.

## Nginx Configuration Helpers

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.5
7.1.0
2 changes: 1 addition & 1 deletion VERSION_MINOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0
7.1
6 changes: 3 additions & 3 deletions generate-dockerfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -euo pipefail

docker pull bfren/alpine

BASE_VERSION="6.0.5"
PHP_BRANCH="v2.0.5"
PHP_VERSIONS="7.4 8.0 8.1 8.2"
BASE_VERSION="6.1.0"
PHP_BRANCH="v2.1.0"
PHP_VERSIONS="7.4 8.0 8.1 8.2 8.3"

for V in ${PHP_VERSIONS} ; do

Expand Down
4 changes: 1 addition & 3 deletions overlay/php-ini.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"session.cookie_secure": 1,
"session.gc_maxlifetime": "86400",
"session.name": "bf-nginx-php-sessid",
"session.save_path": "/tmp/php/session",
"session.use_strict_mode": 1,
"upload_max_filesize": "64M",
"upload_tmp_dir": "/tmp/php/upload"
"upload_max_filesize": "64M"
}
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

IMAGE=`cat VERSION`
PHP=${1:-8.2}
PHP=${1:-8.3}

docker buildx build \
--load \
Expand Down
3 changes: 3 additions & 0 deletions www-conf-sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"clear_env": "yes"
}

0 comments on commit f83166b

Please sign in to comment.