Skip to content

Commit

Permalink
Update docker php82 to 8.2.18, php83 to 8.3.6 and other needed packages
Browse files Browse the repository at this point in the history
  • Loading branch information
stankolubomir committed Apr 19, 2024
1 parent 3431a9d commit 928d6d0
Show file tree
Hide file tree
Showing 48 changed files with 185 additions and 151 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ Additionally, it has preinstalled some libraries (xdebug, libvips, redis, mongod

## What's inside

- PHP 8.2 - 8.2.16
- PHP 8.3 - 8.3.3
- PHP Apcu ext - 5.1.23
- PHP Mongodb ext - 1.17.2
- PHP Redis ext - 6.0.2
- PHP Pcov ext - 1.0.11
- PHP Xdebug ext - 3.3.1
- Redis (client) - 6.2.14
- Supervisor - 4.2.5
- Composer - 2.7.1
- PHP 8.2
- PHP 8.3
- PHP Apcu ext
- PHP Mongodb ext
- PHP Redis ext
- PHP Pcov ext
- PHP Xdebug ext
- Redis (client)
- Supervisor
- Composer
- Vipsffmpeg variant:
- PHP Vips ext - 1.0.13
- FFmpeg - 5.1.4
- LibVips - 8.15.1
- PHP Vips ext
- FFmpeg
- LibVips
- Nginx variant:
- Nginx - 1.24.0
- Nginx-xslt - 1.24.0
- Nginx-geoip - 1.24.0
- Nginx-image-filter - 1.24.0
- Nginx-njs - 0.8.3
- Nginx
- Nginx-xslt
- Nginx-geoip
- Nginx-image-filter
- Nginx-njs

See versions in [version.conf](https://github.com/anzusystems/docker-php/blob/main/versions.conf) file.

### Special common commands

Expand Down
17 changes: 10 additions & 7 deletions build/php82/cli/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY!
# CHECK README FOR MORE INFO.
#
FROM php:8.2.16-cli
FROM php:8.2.18-cli

LABEL maintainer="Lubomir Stanko <[email protected]>"

Expand All @@ -13,6 +13,8 @@ LABEL maintainer="Lubomir Stanko <[email protected]>"
# ----------------------------------------------------------------------------------------------------------------------
# Building envs
ENV MAKEFLAGS="-j4"
# Common envs
ENV PROJECT_ROOT="/var/www/html"
# Php
# Php error reporting constants https://www.php.net/manual/en/errorfunc.constants.php
# Calculate the number for config on https://maximivanov.github.io/php-error-reporting-calculator/
Expand Down Expand Up @@ -45,7 +47,8 @@ ENV PHP_DATE_TIMEZONE="UTC" \
PHP_SLOW_LOG="/proc/self/fd/2" \
PHP_UPLOAD_MAX_FILESIZE="20M" \
PHP_VARIABLES_ORDER="GPCS" \
XDEBUG_LOG="/var/www/html/xdebug.log"
PROJECT_WEBROOT="${PROJECT_ROOT}/public" \
XDEBUG_LOG="${PROJECT_ROOT}/xdebug.log"
# Composer
ENV COMPOSER_HOME="/composer" \
PATH="/composer/vendor/bin:$PATH"
Expand Down Expand Up @@ -122,10 +125,10 @@ RUN apt-get update && \
apt-get install -y \
${PECL_BUILD_DEPS} && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install apcu-5.1.23 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install mongodb-1.17.2 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install mongodb-1.18.1 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install pcov-1.0.11 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install redis-6.0.2 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install xdebug-3.3.1 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install xdebug-3.3.2 && \
docker-php-ext-enable \
apcu \
mongodb \
Expand Down Expand Up @@ -159,7 +162,7 @@ RUN curl -sS https://getcomposer.org/installer | \
php -- \
--install-dir=/usr/local/bin \
--filename=composer \
--version=2.7.1
--version=2.7.2

# ----------------------------------------------------------------------------------------------------------------------
# REDIS-TOOLS
Expand All @@ -170,7 +173,7 @@ RUN DEBIAN_FRONTEND=noninteractive && \
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o ${REDIS_KEYRING} && \
echo "deb [signed-by=${REDIS_KEYRING}] https://packages.redis.io/deb ${REDIS_REPO} main" > /etc/apt/sources.list.d/redis.list && \
apt-get update && \
apt-get install -y redis-tools=6:6.2.14-1rl1~bookworm1 && \
apt-get install -y redis-tools=6:7.2.4-1rl1~bookworm1 && \
# Cleanup
apt-get clean && \
rm -r /var/lib/apt/lists/*
Expand All @@ -188,6 +191,6 @@ COPY ./usr /usr
# RUN
# Run setup and entrypoint start
# ----------------------------------------------------------------------------------------------------------------------
WORKDIR /var/www/html
WORKDIR ${PROJECT_ROOT}

ENTRYPOINT ["docker-entrypoint"]
8 changes: 4 additions & 4 deletions build/php82/cli/base/usr/local/bin/create-user
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set -euo pipefail
USER_UID=${1:-1000}
USER_GID=${2:-1000}
SYSTEM_FOLDERS=(
"${PROJECT_ROOT:-/var/www/html}"
"${PROJECT_ROOT:-/var/www/html}/var/log"
"${COMPOSER_HOME:-/composer}"
"${COMPOSER_HOME:-/composer}/cache"
"/etc/ImageMagick-6"
"/etc/nginx"
"/etc/supervisor"
Expand All @@ -19,10 +23,6 @@ SYSTEM_FOLDERS=(
"/var/log/php"
"/var/run/php"
"/var/run/supervisor"
"/var/www/html"
"/var/www/html/var/log"
"${COMPOSER_HOME:-/composer}"
"${COMPOSER_HOME:-/composer}/cache"
)

echo "Creating \"user\" group with GID \"${USER_GID}\""
Expand Down
4 changes: 2 additions & 2 deletions build/php82/cli/base/usr/local/bin/cron-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

CRON_LOG_LEVEL="${CRON_LOG_LEVEL:-warn}"
CRON_LOG_DIR="${CRON_LOG_DIR:-/var/www/html/var/log}"
CRON_LOG_DIR="${CRON_LOG_DIR:-${PROJECT_ROOT:-/var/www/html}/var/log}"

ARGS=$*
COMMAND_NAME=""
Expand Down Expand Up @@ -98,7 +98,7 @@ function execute() {

_info "Starting cron task \"${COMMAND_NAME}\""

cd /var/www/html || exit 1
cd "${PROJECT_ROOT:-/var/www/html}" || exit 1
if [ -n "${LOCK_FILE}" ]; then
_set
flock -w 50 -E 99 "${LOCK_FILE}" bash -c "$command" || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SUPERVISOR_MESSENGER_PRIORITY=20
SUPERVISOR_MESSENGER_TIME_LIMIT=${SUPERVISOR_MESSENGER_TIME_LIMIT:-3600}
SUPERVISOR_MESSENGER_VERBOSITY=${SUPERVISOR_MESSENGER_VERBOSITY:-}
# Logging configuration
MESSENGER_LOG_PREFIX=${MESSENGER_LOG_PREFIX:-/var/www/html/var/log}
MESSENGER_LOG_PREFIX=${MESSENGER_LOG_PREFIX:-${PROJECT_ROOT:-/var/www/html}/var/log}
SUPERVISOR_LOG_TO_FILE_ENABLED=${SUPERVISOR_LOG_TO_FILE_ENABLED:-true}
SUPERVISOR_STDOUT_LOGFILE="/dev/stdout"
SUPERVISOR_STDERR_LOGFILE="/dev/stderr"
Expand Down
2 changes: 1 addition & 1 deletion build/php82/cli/base/usr/local/bin/start-messenger
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TIME_LIMIT=3600
LIMIT=1000
VERBOSITY=""

cd /var/www/html || exit 1
cd "${PROJECT_ROOT:-/var/www/html}" || exit 1

function help() {
echo -en "$(printf %q "${BASH_SOURCE[0]}") [OPERATION] [OPTIONS]
Expand Down
21 changes: 12 additions & 9 deletions build/php82/cli/vipsffmpeg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY!
# CHECK README FOR MORE INFO.
#
FROM php:8.2.16-cli
FROM php:8.2.18-cli

LABEL maintainer="Lubomir Stanko <[email protected]>"

Expand All @@ -13,6 +13,8 @@ LABEL maintainer="Lubomir Stanko <[email protected]>"
# ----------------------------------------------------------------------------------------------------------------------
# Building envs
ENV MAKEFLAGS="-j4"
# Common envs
ENV PROJECT_ROOT="/var/www/html"
# Php
# Php error reporting constants https://www.php.net/manual/en/errorfunc.constants.php
# Calculate the number for config on https://maximivanov.github.io/php-error-reporting-calculator/
Expand Down Expand Up @@ -45,7 +47,8 @@ ENV PHP_DATE_TIMEZONE="UTC" \
PHP_SLOW_LOG="/proc/self/fd/2" \
PHP_UPLOAD_MAX_FILESIZE="20M" \
PHP_VARIABLES_ORDER="GPCS" \
XDEBUG_LOG="/var/www/html/xdebug.log"
PROJECT_WEBROOT="${PROJECT_ROOT}/public" \
XDEBUG_LOG="${PROJECT_ROOT}/xdebug.log"
# Composer
ENV COMPOSER_HOME="/composer" \
PATH="/composer/vendor/bin:$PATH"
Expand Down Expand Up @@ -122,10 +125,10 @@ RUN apt-get update && \
apt-get install -y \
${PECL_BUILD_DEPS} && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install apcu-5.1.23 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install mongodb-1.17.2 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install mongodb-1.18.1 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install pcov-1.0.11 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install redis-6.0.2 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install xdebug-3.3.1 && \
yes '' | MAKEFLAGS="-j$(($(nproc)+2))" pecl install xdebug-3.3.2 && \
docker-php-ext-enable \
apcu \
mongodb \
Expand Down Expand Up @@ -159,7 +162,7 @@ RUN curl -sS https://getcomposer.org/installer | \
php -- \
--install-dir=/usr/local/bin \
--filename=composer \
--version=2.7.1
--version=2.7.2

# ----------------------------------------------------------------------------------------------------------------------
# REDIS-TOOLS
Expand All @@ -170,7 +173,7 @@ RUN DEBIAN_FRONTEND=noninteractive && \
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o ${REDIS_KEYRING} && \
echo "deb [signed-by=${REDIS_KEYRING}] https://packages.redis.io/deb ${REDIS_REPO} main" > /etc/apt/sources.list.d/redis.list && \
apt-get update && \
apt-get install -y redis-tools=6:6.2.14-1rl1~bookworm1 && \
apt-get install -y redis-tools=6:7.2.4-1rl1~bookworm1 && \
# Cleanup
apt-get clean && \
rm -r /var/lib/apt/lists/*
Expand Down Expand Up @@ -235,10 +238,10 @@ RUN DEBIAN_FRONTEND=noninteractive && \
${VIPS_RUN_DEPS} && \
cd /tmp && \
wget -qc \
https://github.com/libvips/libvips/releases/download/v8.15.1/vips-8.15.1.tar.xz \
https://github.com/libvips/libvips/releases/download/v8.15.2/vips-8.15.2.tar.xz \
-O - | \
tar -xJ && \
cd vips-8.15.1 && \
cd vips-8.15.2 && \
meson setup release --libdir=lib --buildtype=release && \
cd release && \
meson compile && \
Expand Down Expand Up @@ -293,6 +296,6 @@ COPY ./usr /usr
# RUN
# Run setup and entrypoint start
# ----------------------------------------------------------------------------------------------------------------------
WORKDIR /var/www/html
WORKDIR ${PROJECT_ROOT}

ENTRYPOINT ["docker-entrypoint"]
8 changes: 4 additions & 4 deletions build/php82/cli/vipsffmpeg/usr/local/bin/create-user
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set -euo pipefail
USER_UID=${1:-1000}
USER_GID=${2:-1000}
SYSTEM_FOLDERS=(
"${PROJECT_ROOT:-/var/www/html}"
"${PROJECT_ROOT:-/var/www/html}/var/log"
"${COMPOSER_HOME:-/composer}"
"${COMPOSER_HOME:-/composer}/cache"
"/etc/ImageMagick-6"
"/etc/nginx"
"/etc/supervisor"
Expand All @@ -19,10 +23,6 @@ SYSTEM_FOLDERS=(
"/var/log/php"
"/var/run/php"
"/var/run/supervisor"
"/var/www/html"
"/var/www/html/var/log"
"${COMPOSER_HOME:-/composer}"
"${COMPOSER_HOME:-/composer}/cache"
)

echo "Creating \"user\" group with GID \"${USER_GID}\""
Expand Down
4 changes: 2 additions & 2 deletions build/php82/cli/vipsffmpeg/usr/local/bin/cron-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

CRON_LOG_LEVEL="${CRON_LOG_LEVEL:-warn}"
CRON_LOG_DIR="${CRON_LOG_DIR:-/var/www/html/var/log}"
CRON_LOG_DIR="${CRON_LOG_DIR:-${PROJECT_ROOT:-/var/www/html}/var/log}"

ARGS=$*
COMMAND_NAME=""
Expand Down Expand Up @@ -98,7 +98,7 @@ function execute() {

_info "Starting cron task \"${COMMAND_NAME}\""

cd /var/www/html || exit 1
cd "${PROJECT_ROOT:-/var/www/html}" || exit 1
if [ -n "${LOCK_FILE}" ]; then
_set
flock -w 50 -E 99 "${LOCK_FILE}" bash -c "$command" || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SUPERVISOR_MESSENGER_PRIORITY=20
SUPERVISOR_MESSENGER_TIME_LIMIT=${SUPERVISOR_MESSENGER_TIME_LIMIT:-3600}
SUPERVISOR_MESSENGER_VERBOSITY=${SUPERVISOR_MESSENGER_VERBOSITY:-}
# Logging configuration
MESSENGER_LOG_PREFIX=${MESSENGER_LOG_PREFIX:-/var/www/html/var/log}
MESSENGER_LOG_PREFIX=${MESSENGER_LOG_PREFIX:-${PROJECT_ROOT:-/var/www/html}/var/log}
SUPERVISOR_LOG_TO_FILE_ENABLED=${SUPERVISOR_LOG_TO_FILE_ENABLED:-true}
SUPERVISOR_STDOUT_LOGFILE="/dev/stdout"
SUPERVISOR_STDERR_LOGFILE="/dev/stderr"
Expand Down
2 changes: 1 addition & 1 deletion build/php82/cli/vipsffmpeg/usr/local/bin/start-messenger
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TIME_LIMIT=3600
LIMIT=1000
VERBOSITY=""

cd /var/www/html || exit 1
cd "${PROJECT_ROOT:-/var/www/html}" || exit 1

function help() {
echo -en "$(printf %q "${BASH_SOURCE[0]}") [OPERATION] [OPTIONS]
Expand Down
Loading

0 comments on commit 928d6d0

Please sign in to comment.