diff --git a/7.4/Dockerfile b/7.4/Dockerfile index 2609f05..5ddf9ee 100644 --- a/7.4/Dockerfile +++ b/7.4/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 05b6dd5..13d8850 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index bd8f55b..b4a8763 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 3cbf9bc..206e343 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 860e33b..0a2a4d7 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 8f20215..2b7ea69 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.4/overlay/tmp/PHP_BUILD b/8.4/overlay/tmp/PHP_BUILD index 0843217..4cfef99 100644 --- a/8.4/overlay/tmp/PHP_BUILD +++ b/8.4/overlay/tmp/PHP_BUILD @@ -1 +1 @@ -8.4.17-r0 \ No newline at end of file +8.4.18-r0 \ No newline at end of file diff --git a/8.4/overlay/tmp/PHP_REVISION b/8.4/overlay/tmp/PHP_REVISION index d7b295f..0b95416 100644 --- a/8.4/overlay/tmp/PHP_REVISION +++ b/8.4/overlay/tmp/PHP_REVISION @@ -1 +1 @@ -8.4.17 \ No newline at end of file +8.4.18 \ No newline at end of file diff --git a/8.5/Dockerfile b/8.5/Dockerfile index 3910246..cc8bf1f 100644 --- a/8.5/Dockerfile +++ b/8.5/Dockerfile @@ -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 v3.1.5 https://github.com/bfren/docker-php.git && \ + apk add git && git clone --branch v3.1.6 https://github.com/bfren/docker-php.git && \ mkdir /overlay && \ mv docker-php/overlay/etc /overlay/ diff --git a/8.5/overlay/tmp/PHP_BUILD b/8.5/overlay/tmp/PHP_BUILD index 454c094..052c3ca 100644 --- a/8.5/overlay/tmp/PHP_BUILD +++ b/8.5/overlay/tmp/PHP_BUILD @@ -1 +1 @@ -8.5.2-r0 \ No newline at end of file +8.5.3-r0 \ No newline at end of file diff --git a/8.5/overlay/tmp/PHP_REVISION b/8.5/overlay/tmp/PHP_REVISION index bd0b85a..6a29595 100644 --- a/8.5/overlay/tmp/PHP_REVISION +++ b/8.5/overlay/tmp/PHP_REVISION @@ -1 +1 @@ -8.5.2 \ No newline at end of file +8.5.3 \ No newline at end of file diff --git a/VERSION b/VERSION index daf8e4c..dd9a10b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.1.5 \ No newline at end of file +8.1.6 \ No newline at end of file diff --git a/generate-dockerfiles.sh b/generate-dockerfiles.sh index 88289f7..e330c02 100755 --- a/generate-dockerfiles.sh +++ b/generate-dockerfiles.sh @@ -5,7 +5,7 @@ set -euo pipefail docker pull bfren/alpine BASE_VERSION="7.1.4" -PHP_BRANCH="v3.1.5" +PHP_BRANCH="v3.1.6" PHP_VERSIONS="7.4 8.0 8.1 8.2 8.3 8.4 8.5" for V in ${PHP_VERSIONS} ; do diff --git a/overlay/etc/bf/init.d/22-php-ini.nu b/overlay/etc/bf/init.d/22-php-ini.nu index a52f7e2..daccdca 100644 --- a/overlay/etc/bf/init.d/22-php-ini.nu +++ b/overlay/etc/bf/init.d/22-php-ini.nu @@ -1,15 +1,15 @@ use bf +use bf-nginx-php use bf-php bf env load # Apply any overrides to php.ini export def main [] { - # load any override files and apply them - let ini_override = bf env PHP_INI_OVERRIDE_D - if ($ini_override | path exists) { $"($ini_override)/*.json" | into glob | ls --full-paths $in | get name | sort | each {|x| - let override_values = bf fs read $x | from json - bf-php ini $override_values - } } + # get ini override values + let override_values = bf-nginx-php ini get_override_values + + # download specified php.ini file and apply any override values + bf-php ini $override_values # return nothing return diff --git a/overlay/etc/nu/scripts/bf-nginx-php/ini.nu b/overlay/etc/nu/scripts/bf-nginx-php/ini.nu new file mode 100644 index 0000000..7ec3663 --- /dev/null +++ b/overlay/etc/nu/scripts/bf-nginx-php/ini.nu @@ -0,0 +1,25 @@ +use bf + +# Get php.ini override values +export def get_override_values []: nothing -> record { + # get variables + let ini_override = bf env PHP_INI_OVERRIDE_D + + # if the override path does not exist return nothing + if not ($ini_override | path exists) { + return + } + + # load override json files, + # sorted alphabetically + # read as json + # reduce array so later values override earlier values + return $"($ini_override)/*.json" + | into glob + | ls --full-paths $in + | get name + | sort --natural + | each {|x| bf fs read $x | from json } + | reduce {|it, acc| $acc | merge $it } + | into record +} diff --git a/overlay/etc/nu/scripts/bf-nginx-php/mod.nu b/overlay/etc/nu/scripts/bf-nginx-php/mod.nu index 1113be2..c317f45 100644 --- a/overlay/etc/nu/scripts/bf-nginx-php/mod.nu +++ b/overlay/etc/nu/scripts/bf-nginx-php/mod.nu @@ -1,3 +1,4 @@ export module conf.nu +export module ini.nu export module run.nu export module sessions.nu diff --git a/overlay/etc/nu/scripts/bf-nginx-php/sessions.nu b/overlay/etc/nu/scripts/bf-nginx-php/sessions.nu index 60b5c08..a2c608f 100644 --- a/overlay/etc/nu/scripts/bf-nginx-php/sessions.nu +++ b/overlay/etc/nu/scripts/bf-nginx-php/sessions.nu @@ -1,4 +1,5 @@ use bf +use ini.nu # Clean sessions as user www export def clean [] { @@ -6,11 +7,8 @@ export def clean [] { bf env load # get session max lifetime (if set) - let ini_override = bf env PHP_INI_OVERRIDE - let max_lifetime = match ($ini_override | path exists) { - true => ($ini_override | open | get --optional "session.gc_maxlifetime") - false => 86400 - } + let ini_override = bf env PHP_INI_OVERRIDE_D + let max_lifetime = ini get_override_values | default 86400 session.gc_maxlifetime # hat-tip https://www.getpagespeed.com/server-setup/php/cleanup-php-sessions-like-a-pro let args = [