Skip to content

Commit

Permalink
Release 7.5.0 - See CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tiredofit committed Mar 15, 2023
1 parent 6775584 commit 1a43f59
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 39 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 7.5.0 2023-03-15 <dave at tiredofit dot ca>

### Changed
- Quiet down output when loading defaults (xxx is already loaded! warnings)
- Rework initialization
- Fix a weird opcache issue


## 7.4.2 2023-02-21 <radarsymphony@github>

### Changed
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ARG DISTRO=alpine
ARG DISTRO_VARIANT=3.17
ARG DISTRO_VARIANT=edge

FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT}
LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)"

ARG PHP_BASE

ENV PHP_BASE=${PHP_BASE:-"8.1"} \
ENV PHP_BASE=${PHP_BASE:-"8.2"} \
PHP_ENABLE_APCU=TRUE \
PHP_ENABLE_BCMATH=TRUE \
PHP_ENABLE_BZ2=TRUE \
Expand Down Expand Up @@ -813,8 +813,11 @@ RUN case "${PHP_BASE}" in \
#### Disabling any but core extensions - When using this image as a base for other images, you'll want to turn turn them on before running composer with the inverse of phpdisomd (phpenmod) to keep things clean
set +x && \
for module in /etc/php${php_folder}/conf.d/*.ini; do if [ ! -L "${module}" ] ; then if [ "$(echo $(basename $module) | grep -c '^[0-9][0-9].*')" = "0" ] ; then mv "${module}" "$(dirname ${module})/20_$(basename ${module})" ; module="$(dirname ${module})/20_$(basename ${module})"; fi ; if ! grep -w -i -q ";priority" "$module"; then echo ";priority=$(basename $module .ini | cut -d _ -f1)" >> $module ; mv "${module}" /etc/php${php_folder}/mods-available/$(basename ${module} .ini | cut -c 4-).ini; fi; fi; done; \

rm -rf /etc/php${php_folder}/conf.d/* && \
sed -i "s|;priority=00|;priority=10|g" /etc/php${php_folder}/mods-available/opcache.ini && \
php_env_plugins_enabled="$(set | sort | grep PHP_ENABLE_ | grep -i TRUE | cut -d _ -f 3 | cut -d = -f 1 | tr [A-Z] [a-z])" && \
cat /etc/php${php_folder}/mods-available/opcache.ini && \
for module in $php_env_plugins_enabled ; do if [ -f "/etc/php${php_folder}/mods-available/${module}.ini" ] ; then priority=$(cat /etc/php${php_folder}/mods-available/${module}.ini | grep ";priority" | cut -d = -f2) ; ln -sf "/etc/php${php_folder}/mods-available/${module}.ini" /etc/php${php_folder}/conf.d/${priority}-${module}.ini ; fi ; done ; \
if [ "${PHP_BASE:0:1}" != "8" ] ; then priority=$(cat /etc/php${PHP_BASE:0:1}/mods-available/json.ini | grep ";priority" | cut -d = -f2) ; ln -sf "/etc/php${PHP_BASE:0:1}/mods-available/json.ini" /etc/php${PHP_BASE:0:1}/conf.d/${priority}-json.ini ; fi ; \
set -x && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ The following directories are used for configuration and can be mapped for persi

#### Base Images used

This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) or [Debian Linux](https://hub.docker.com/r/tiredofit/debian) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`,`vim`.
This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) or [Debian Linux](https://hub.docker.com/r/tiredofit/debian) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`.
Be sure to view the following repositories to understand all the customizable options:

| Image | Description |
Expand Down
2 changes: 1 addition & 1 deletion install/assets/defaults/20-php-fpm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PHP_OPCACHE_REVALIDATE_FREQ=${PHP_OPCACHE_REVALIDATE_FREQ:-"60"}
PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE:-"2G"}
PHP_TIMEOUT=${PHP_TIMEOUT:-"180"}
PHP_UPLOAD_MAX_SIZE=${PHP_UPLOAD_MAX_SIZE:-"2G"}
PHP_VERSION=${PHP_VERSION:-$(php -v | head -n 1 | awk '{print $2}')}
PHP_VERSION=${PHP_VERSION:-$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}')}
PHP_WEBROOT=${PHP_WEBROOT:-$NGINX_WEBROOT}

#Xdebug 2
Expand Down
64 changes: 32 additions & 32 deletions install/assets/functions/20-php-fpm
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ phpfpm_bootstrap() {
php_prefix="/etc/php82/"
;;
* )
php_prefix="/etc/php$(php -v | head -n 1 | awk '{print $2}' | cut -c 1)/"
php_prefix="/etc/php$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1)/"
;;
esac
;;
"debian" )
php_prefix="/etc/php/$(php -v | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
php_prefix="/etc/php/$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
;;
esac

Expand Down Expand Up @@ -132,26 +132,6 @@ EOF
EOF
fi
fi

if var_false "${PHP_KITCHENSINK}" ; then
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
unset PHP_ENABLE_CREATE_SAMPLE_PHP # legacy
php_env_plugins_enabled=$(set -o posix; set | sort | grep PHP_ENABLE_ | grep -i TRUE |sed -e 's/PHP_ENABLE_//g' | sed -e 's/=TRUE//g' | awk -vRS="" -vOFS=', ' '$1=$1' | tr A-Z a-z)
for module in $(echo "${php_env_plugins_enabled}" | tr "," "\n" ) ; do
if [ -f "${php_prefix}"/mods-available/"${module}".ini ]; then
print_debug "Enabling ${module}"
silent php-ext enable "${module}"
php_actual_plugins_enabled="${php_actual_plugins_enabled} ${module}"
else
print_error "Requested enabling ${module} however it doesn't exist!"
fi
done
print_notice "PHP-FPM Preparing to start with the following plugins enabled: ${php_actual_plugins_enabled}"
else
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
print_warn "Enabling Kitchen Sink mode and allowing all plugins to be active"
silent php-ext enable all
fi
}

phpfpm_configure_logging() {
Expand Down Expand Up @@ -325,6 +305,17 @@ EOF
}

phpfpm_post_init() {
case ${os} in
"alpine" )
cp -R /assets/php-fpm/cli/php.ini "${php_prefix}"/
cp -R /assets/php-fpm/mods-available/* "${php_prefix}"/mods-available/
cp -R /assets/php-fpm/fpm/php-fpm.conf "${php_prefix}"/
;;
"debian" )
cp -R /assets/php-fpm/* "${php_prefix}"
;;
esac

case ${os} in
"alpine" )
### Weird Opcache issue
Expand All @@ -340,16 +331,25 @@ phpfpm_post_init() {
;;
esac

case ${os} in
"alpine" )
cp -R /assets/php-fpm/cli/php.ini "${php_prefix}"/
cp -R /assets/php-fpm/mods-available/* "${php_prefix}"/mods-available/
cp -R /assets/php-fpm/fpm/php-fpm.conf "${php_prefix}"/
;;
"debian" )
cp -R /assets/php-fpm/* "${php_prefix}"
;;
esac
if var_false "${PHP_KITCHENSINK}" ; then
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
unset PHP_ENABLE_CREATE_SAMPLE_PHP # legacy
php_env_plugins_enabled=$(set -o posix; set | sort | grep PHP_ENABLE_ | grep -i TRUE |sed -e 's/PHP_ENABLE_//g' | sed -e 's/=TRUE//g' | awk -vRS="" -vOFS=', ' '$1=$1' | tr A-Z a-z)
for module in $(echo "${php_env_plugins_enabled}" | tr "," "\n" ) ; do
if [ -f "${php_prefix}"/mods-available/"${module}".ini ]; then
print_debug "Enabling ${module}"
silent php-ext enable "${module}"
php_actual_plugins_enabled="${php_actual_plugins_enabled} ${module}"
else
print_error "Requested enabling ${module} however it doesn't exist!"
fi
done
print_debug "PHP-FPM Preparing to start with the following extensions enabled: ${php_actual_plugins_enabled}"
else
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
print_warn "Enabling Kitchen Sink mode and allowing all plugins to be active"
silent php-ext enable all
fi

chmod -R 0755 "${php_prefix}"
chown -R root:"${NGINX_GROUP}" "${php_prefix}"
Expand Down
6 changes: 3 additions & 3 deletions install/usr/sbin/php-ext
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ case ${os} in
php_prefix="/etc/php82/"
;;
* )
php_prefix="/etc/php$(php -v | head -n 1 | awk '{print $2}' | cut -c 1)/"
php_prefix="/etc/php$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1)/"
;;
esac
;;
"debian" )
php_prefix="/etc/php/$(php -v | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
php_prefix="/etc/php/$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
;;
esac

if [ "${PHP_ENABLE_OPENSSL,,}" = "true" ] && [ ! -f "${php_prefix}mods-available/openssl.ini" ]; then
if [ "${PHP_ENABLE_OPENSSL,,}" = "true" ] && [ ! -f "${php_prefix}/mods-available/openssl.ini" ]; then
export PHP_ENABLE_OPENSSL=FALSE
fi

Expand Down

0 comments on commit 1a43f59

Please sign in to comment.