diff --git a/.env.example b/.env.example index 891e143..9ccbcd5 100644 --- a/.env.example +++ b/.env.example @@ -30,7 +30,7 @@ APACHE_SSL_REDIRECT=false # Docker Build Configuration BUILD_TYPE=dev ENABLE_HEALTH_ENDPOINT=true -PHP_VERSION=8.4 +PHP_VERSION=8.5 # PHP Core Configuration PHP_MAX_EXECUTION_TIME=60 diff --git a/.github/actions/prepare-docker-tags/action.yml b/.github/actions/prepare-docker-tags/action.yml index 2020243..4e4cd83 100644 --- a/.github/actions/prepare-docker-tags/action.yml +++ b/.github/actions/prepare-docker-tags/action.yml @@ -13,7 +13,7 @@ inputs: required: true php-version: description: PHP version. - default: "8.4" + default: "8.5" required: false flavor-prefix: description: Flavor prefix. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb1d0bc..ae975c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ concurrency: name: build env: - PHP_VERSION: "8.4" + PHP_VERSION: "8.5" REGISTRY: ghcr.io jobs: @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout. - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup Docker Buildx. uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d7223c..636686e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ concurrency: name: release env: - PHP_VERSION: "8.4" + PHP_VERSION: "8.5" REGISTRY: ghcr.io jobs: @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Validate Version id: validate @@ -62,7 +62,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 @@ -161,7 +161,7 @@ jobs: if [[ "${{ env.BUILD_RESULT }}" == "success" ]]; then echo "## 🏷️ Generated Tags" - echo "- \`8.4-debian-{build_type}-v${{ env.VERSION }}\`" + echo "- \`${{ env.PHP_VERSION }}-debian-{build_type}-v${{ env.VERSION }}\`" if [[ "${{ env.IS_PRERELEASE }}" == "false" ]]; then echo "- \`latest\` (prod only)" fi diff --git a/CHANGELOG.md b/CHANGELOG.md index a8166b8..ce1c98f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## v1.1.0 Under Development +- Enh #32 Update to PHP `8.5` (@terabytesoftw) + ## v1.0.0 September 13, 2025 - Enh #1: Add Apache, PHP `8.4`, PHP-FPM, and HTTP/2 support, image for Debian Trixie (@terabytesoftw) diff --git a/README.md b/README.md index 45e3336..c90c679 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Production-ready Docker images for Yii2 applications with Apache, PHP-FPM, and H - ✅ **Apache 2.4** with HTTP/2, Brotli compression, and SSL/TLS - ✅ **Auto SSL** certificate generation for development - ✅ **Health checks** and monitoring endpoints -- ✅ **PHP 8.4** with FPM and essential extensions (Redis, MongoDB, MySQL, PostgreSQL) +- ✅ **PHP 8.5** with FPM and essential extensions (Redis, MongoDB, MySQL, PostgreSQL) - ✅ **Security hardened** with modern configurations - ✅ **Supervisor** for process management - ✅ **Three build variants**: `dev`, `prod`, and `full` @@ -26,13 +26,13 @@ Pull and run the image. ```bash # Development build with Xdebug -docker run -d -p 8080:80 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.4-debian-dev-v1.0.0 +docker run -d -p 8080:80 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.5-debian-dev-v1.0.0 # Production build with optimizations -docker run -d -p 80:80 -p 443:443 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.4-debian-prod-v1.0.0 +docker run -d -p 80:80 -p 443:443 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.5-debian-prod-v1.0.0 # Full testing build with all extensions -docker run -d -p 8080:80 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.4-debian-full-v1.0.0 +docker run -d -p 8080:80 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.5-debian-full-v1.0.0 ``` ### Docker Compose @@ -46,7 +46,7 @@ version: '3.8' services: web: - image: ghcr.io/yii2-extensions/apache:8.4-debian-dev-v1.0.0 + image: ghcr.io/yii2-extensions/apache:8.5-debian-dev-v1.0.0 ports: - "8080:80" - "8443:443" @@ -64,18 +64,18 @@ services: #### Development (`dev`) ```bash -docker pull ghcr.io/yii2-extensions/apache:8.4-debian-dev-v1.0.0 +docker pull ghcr.io/yii2-extensions/apache:8.5-debian-dev-v1.0.0 ``` - Error reporting enabled with detailed logging - Node.js integration for asset compilation - OPcache with revalidation for development workflow -- PHP `8.4` with Xdebug, Memcached, MongoDB, SOAP, YAML +- PHP `8.5` with Xdebug, Memcached, MongoDB, SOAP, YAML #### Production (`prod`) ```bash -docker pull ghcr.io/yii2-extensions/apache:8.4-debian-prod-v1.0.0 +docker pull ghcr.io/yii2-extensions/apache:8.5-debian-prod-v1.0.0 ``` - Minimal extension set with maximum performance @@ -86,7 +86,7 @@ docker pull ghcr.io/yii2-extensions/apache:8.4-debian-prod-v1.0.0 #### Full Testing (`full`) ```bash -docker pull ghcr.io/yii2-extensions/apache:8.4-debian-full-v1.0.0 +docker pull ghcr.io/yii2-extensions/apache:8.5-debian-full-v1.0.0 ``` - All development extensions plus OCI8, SQL Server, Tidy diff --git a/src/flavor/apache/Dockerfile b/src/flavor/apache/Dockerfile index da87ed9..5d05980 100644 --- a/src/flavor/apache/Dockerfile +++ b/src/flavor/apache/Dockerfile @@ -1,10 +1,10 @@ #============================================================================== -# Yii2 Docker - Debian Trixie + PHP 8.4 FPM + Apache with HTTP/2 +# Yii2 Docker - Debian Trixie + PHP 8.5 FPM + Apache with HTTP/2 # Supports: full (testing), dev (development), prod (production) #============================================================================== ARG BUILD_TYPE=dev -ARG PHP_VERSION=8.4 +ARG PHP_VERSION=8.5 #------------------------------------------------------------------------------ # Base System @@ -167,6 +167,8 @@ RUN install-php-extensions \ #------------------------------------------------------------------------------ FROM dev AS full +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + # Layer 07: Full extensions RUN install-php-extensions \ oci8 \ @@ -175,21 +177,41 @@ RUN install-php-extensions \ # Layer 08: Microsoft SQL Server support # Note: Using Debian 12 (bookworm) repo since Trixie (13) is not yet officially supported by Microsoft -RUN /bin/bash -o pipefail -c "set -ex \ +# hadolint ignore=DL3003,SC2153 +RUN set -ex \ && apt-get update \ && apt-get install -y --no-install-recommends \ curl \ gnupg \ ca-certificates \ && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \ - && echo \"deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main\" > /etc/apt/sources.list.d/mssql-release.list \ + && echo 'deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main' > /etc/apt/sources.list.d/mssql-release.list \ && apt-get update \ && ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 \ - && apt-get install -y --no-install-recommends unixodbc-dev \ - && install-php-extensions sqlsrv pdo_sqlsrv \ - && apt-get purge -y --auto-remove gnupg \ + && read -r -a phpize_deps <<< "${PHPIZE_DEPS}" \ + && apt-get install -y --no-install-recommends unixodbc unixodbc-dev "${phpize_deps[@]}" \ + && printf '\\n' | pecl install sqlsrv-5.12.0 \ + && PHP_VERSION_ID="$(php -r 'echo PHP_VERSION_ID;')" \ + && if [[ "${PHP_VERSION_ID}" -ge 80500 ]]; then \ + cd /tmp \ + && pecl download pdo_sqlsrv-5.12.0 \ + && tar -xf pdo_sqlsrv-5.12.0.tgz \ + && rm -f pdo_sqlsrv-5.12.0.tgz \ + && cd pdo_sqlsrv-5.12.0 \ + && sed -i 's/= dbh->error_mode/= (enum pdo_error_mode) dbh->error_mode/' pdo_dbh.cpp \ + && sed -i 's/zval_ptr_dtor( &dbh->query_stmt_zval );/OBJ_RELEASE(dbh->query_stmt_obj);dbh->query_stmt_obj=NULL;/' php_pdo_sqlsrv_int.h \ + && phpize \ + && ./configure --with-php-config="$(command -v php-config)" \ + && make -j"$(nproc)" \ + && make install \ + && rm -rf /tmp/pdo_sqlsrv-5.12.0; \ + else \ + printf '\\n' | pecl install pdo_sqlsrv-5.12.0; \ + fi \ + && docker-php-ext-enable sqlsrv pdo_sqlsrv \ + && apt-get purge -y --auto-remove gnupg unixodbc-dev "${phpize_deps[@]}" \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*" + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* #============================================================================== # Production Build