From fb6572d24959a4ed1f50dd98df06aff2933c2baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Wed, 12 Nov 2025 17:10:19 +0000 Subject: [PATCH 1/2] feat: add PHP 8.4 support --- .github/workflows/ci.yml | 1 + 8.4/Dockerfile | 59 +++++++++++++++++++ common/etc/entrypoint.d/0-container-info.sh | 34 +++++++++++ .../entrypoint.d/51-filament-automation.sh | 20 +++++++ common/etc/entrypoint.d/99-laravel-about.sh | 14 +++++ common/etc/profile.d/aliases.sh | 1 + 6 files changed, 129 insertions(+) create mode 100644 8.4/Dockerfile create mode 100644 common/etc/entrypoint.d/0-container-info.sh create mode 100644 common/etc/entrypoint.d/51-filament-automation.sh create mode 100644 common/etc/entrypoint.d/99-laravel-about.sh create mode 100644 common/etc/profile.d/aliases.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b3ca13..ab569b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: matrix: php-version: - 8.2 + - 8.4 steps: - name: Checkout diff --git a/8.4/Dockerfile b/8.4/Dockerfile new file mode 100644 index 0000000..b6d23e3 --- /dev/null +++ b/8.4/Dockerfile @@ -0,0 +1,59 @@ +FROM serversideup/php:8.4-fpm-nginx-alpine + +COPY --chmod=755 common/ / + +# PHP limits +ENV PHP_MEMORY_LIMIT=256M +ENV PHP_POST_MAX_SIZE=100M +ENV PHP_UPLOAD_MAX_FILE_SIZE=${PHP_POST_MAX_SIZE} + +# OPcache settings +ENV PHP_OPCACHE_ENABLE=1 +ENV PHP_OPCACHE_INTERNED_STRINGS_BUFFER=8 +ENV PHP_OPCACHE_MEMORY_CONSUMPTION=128 +ENV PHP_OPCACHE_REVALIDATE_FREQ=2 + +# PHP-FPM settings +ENV PHP_FPM_PM_CONTROL=ondemand +ENV PHP_FPM_PM_MAX_CHILDREN=20 +ENV PHP_FPM_PM_START_SERVERS=2 +ENV PHP_FPM_PM_MIN_SPARE_SERVERS=1 +ENV PHP_FPM_PM_MAX_SPARE_SERVERS=3 + +# Laravel settings +ENV AUTORUN_ENABLED=true +ENV AUTORUN_LARAVEL_MIGRATION=true +ENV AUTORUN_LARAVEL_STORAGE_LINK=true +ENV AUTORUN_LARAVEL_CONFIG_CACHE=true +ENV AUTORUN_LARAVEL_EVENT_CACHE=true +ENV AUTORUN_LARAVEL_ROUTE_CACHE=true +ENV AUTORUN_LARAVEL_VIEW_CACHE=true +ENV AUTORUN_LARAVEL_FILAMENT=true + +ENV HEALTHCHECK_PATH=/up + +# Composer settings +ENV COMPOSER_NO_INTERACTION=1 +ENV COMPOSER_FUND=0 + +# Switch to root so we can do root things +USER root + +# Install additional PHP extensions +RUN set -ex; \ + install-php-extensions \ + event \ + excimer \ + exif \ + gd \ + intl; + +# Drop back to our unprivileged user +USER www-data + +ARG VERSION +ARG REVISION + +RUN echo "$VERSION (${REVISION:0:7})" > ${APP_BASE_DIR}/.version + +EXPOSE 8080 8443 diff --git a/common/etc/entrypoint.d/0-container-info.sh b/common/etc/entrypoint.d/0-container-info.sh new file mode 100644 index 0000000..72da75d --- /dev/null +++ b/common/etc/entrypoint.d/0-container-info.sh @@ -0,0 +1,34 @@ +#!/bin/sh +if [ "$SHOW_WELCOME_MESSAGE" = "false" ] || [ "$LOG_OUTPUT_LEVEL" = "off" ] || [ "$DISABLE_DEFAULT_CONFIG" = "true" ]; then + if [ "$LOG_OUTPUT_LEVEL" = "debug" ]; then + echo "👉 $0: Container info was display was skipped." + fi + # Skip the rest of the script + return 0 +fi + +PHP_OPCACHE_STATUS=$(php -r 'echo ini_get("opcache.enable");') + +if [ "$PHP_OPCACHE_STATUS" = "1" ]; then + PHP_OPCACHE_MESSAGE="✅ Enabled" +else + PHP_OPCACHE_MESSAGE="❌ Disabled" +fi + +echo ' +------------------------------------- +â„šī¸ Container Information +-------------------------------------' +echo " +OS: $(. /etc/os-release; echo "${PRETTY_NAME}") +Docker user: $(whoami) +Docker uid: $(id -u) +Docker gid: $(id -g) +OPcache: $PHP_OPCACHE_MESSAGE +PHP Version: $(php -r 'echo phpversion();') +Image Version: $(cat /etc/serversideup-php-version) +" + +if [ "$PHP_OPCACHE_STATUS" = "0" ]; then + echo "👉 [NOTICE]: Improve PHP performance by setting PHP_OPCACHE_ENABLE=1 (recommended for production)." +fi diff --git a/common/etc/entrypoint.d/51-filament-automation.sh b/common/etc/entrypoint.d/51-filament-automation.sh new file mode 100644 index 0000000..a13b759 --- /dev/null +++ b/common/etc/entrypoint.d/51-filament-automation.sh @@ -0,0 +1,20 @@ +#!/bin/sh +script_name="filament-automations" + +if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then + # Check to see if an Artisan file exists and assume it means Laravel is configured. + if [ -f "$APP_BASE_DIR/artisan" ]; then + echo "Checking for Filament automations..." + ############################################################################ + # artisan filament:optimize + ############################################################################ + if [ "${AUTORUN_LARAVEL_FILAMENT:=true}" = "true" ]; then + echo "🚀 Caching filament components and Blade icons.." + php "$APP_BASE_DIR/artisan" filament:optimize + fi + fi +else + if [ "$LOG_OUTPUT_LEVEL" = "debug" ]; then + echo "👉 $script_name: DISABLE_DEFAULT_CONFIG does not equal 'false', so automations will NOT be performed." + fi +fi diff --git a/common/etc/entrypoint.d/99-laravel-about.sh b/common/etc/entrypoint.d/99-laravel-about.sh new file mode 100644 index 0000000..4df2719 --- /dev/null +++ b/common/etc/entrypoint.d/99-laravel-about.sh @@ -0,0 +1,14 @@ +#!/bin/sh +script_name="laravel-about" + +if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then + # Check to see if an Artisan file exists and assume it means Laravel is configured. + if [ -f "$APP_BASE_DIR/artisan" ] && [ "${AUTORUN_LARAVEL_ABOUT:=true}" = "true" ]; then + php "$APP_BASE_DIR/artisan" about + fi +else + if [ "$LOG_OUTPUT_LEVEL" = "debug" ]; then + echo "👉 $script_name: DISABLE_DEFAULT_CONFIG does not equal 'false', so automations will NOT be performed." + fi +fi + diff --git a/common/etc/profile.d/aliases.sh b/common/etc/profile.d/aliases.sh new file mode 100644 index 0000000..40bf370 --- /dev/null +++ b/common/etc/profile.d/aliases.sh @@ -0,0 +1 @@ +alias artisan="php '$APP_BASE_DIR'/artisan" From e0c2a44b568e5a0240dac476fbaeb9cb409d2fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Wed, 12 Nov 2025 17:12:27 +0000 Subject: [PATCH 2/2] update workflow --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab569b6..c2ccc22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,6 @@ name: Build and push image to registry on: push: - branches: - - main schedule: - cron: "0 10 * * 1" workflow_dispatch: @@ -50,4 +48,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} no-cache: true - push: true + push: ${{ github.ref == 'refs/heads/main' }}