Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare-docker-tags/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ concurrency:
name: build

env:
PHP_VERSION: "8.4"
PHP_VERSION: "8.5"
REGISTRY: ghcr.io

jobs:
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
name: release

env:
PHP_VERSION: "8.4"
PHP_VERSION: "8.5"
REGISTRY: ghcr.io

jobs:
Expand All @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Validate Version
id: validate
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
38 changes: 30 additions & 8 deletions src/flavor/apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down