From b83d01de23abd066ac18ff9215a45c03b56554f1 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Fri, 11 Sep 2026 09:02:53 +0200 Subject: [PATCH] Add Imagick and Iconv to PHP image --- .gitea/workflows/container.yml | 14 +++++++++++++- Dockerfile | 4 +++- README.md | 11 ++++++----- imagick.ini | 1 + 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 imagick.ini diff --git a/.gitea/workflows/container.yml b/.gitea/workflows/container.yml index c4956af..49b591b 100644 --- a/.gitea/workflows/container.yml +++ b/.gitea/workflows/container.yml @@ -74,7 +74,7 @@ jobs: httpd -k stop ' docker run --rm --entrypoint php "${IMAGE}:${COMMIT_SHA}" -r ' - foreach (["exif", "gd", "intl", "Zend OPcache", "pgsql", "pdo_pgsql"] as $extension) { + foreach (["exif", "gd", "iconv", "imagick", "intl", "Zend OPcache", "pgsql", "pdo_pgsql"] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, "Missing PHP extension: {$extension}\n"); exit(1); @@ -93,7 +93,19 @@ jobs: fwrite(STDERR, "GD resize smoke test failed.\n"); exit(1); } + $imagick = new Imagick(); + $imagick->newImage(8, 8, "white", "png"); + $imagick->resizeImage(4, 4, Imagick::FILTER_LANCZOS, 1); + if ($imagick->getImageWidth() !== 4 || $imagick->getImageHeight() !== 4) { + fwrite(STDERR, "Imagick resize smoke test failed.\n"); + exit(1); + } + if (iconv("UTF-8", "ASCII//TRANSLIT", "Grüße") === false) { + fwrite(STDERR, "Iconv smoke test failed.\n"); + exit(1); + } echo "GD resize smoke test passed.\n"; + echo "Imagick and Iconv smoke tests passed.\n"; ' - name: Determine version tag diff --git a/Dockerfile b/Dockerfile index 5d59b06..d9cac15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM archlinux:latest ENV APACHE_SERVER_ADMIN=webmaster@localhost \ APACHE_STATUS_PORT=8080 -RUN pacman -Syu --noconfirm apache php-apache php php-gd php-pgsql \ +RUN pacman -Syu --noconfirm apache php-apache php php-gd php-imagick php-pgsql \ && pacman -Sc --noconfirm \ && rm -v /var/log/pacman.log /var/lib/pacman/sync/* @@ -21,12 +21,14 @@ RUN sed -i '/mod_mpm_event/ s/^/#/' /etc/httpd/conf/httpd.conf \ && install -d /etc/php/conf.d \ && sed -i -e '/extension=exif/ s/^;//' \ -e '/extension=gd/ s/^;//' \ + -e '/extension=iconv/ s/^;//' \ -e '/extension=intl/ s/^;//' \ -e '/extension=pgsql/ s/^;//' \ -e '/extension=pdo_pgsql/ s/^;//' \ /etc/php/php.ini COPY opcache.ini /etc/php/conf.d/opcache.ini +COPY imagick.ini /etc/php/conf.d/imagick.ini COPY apache-status.conf /etc/httpd/conf/extra/apache-status.conf ENTRYPOINT ["httpd", "-DFOREGROUND"] diff --git a/README.md b/README.md index b3c8dbf..2cb9adc 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,12 @@ Arch Linux container image with Apache and PHP. It is the common runtime for the PHP sites hosted at brunner.ninja, including WordPress and phpPgAdmin. -The image enables PostgreSQL and PDO PostgreSQL, GD for image thumbnails and -responsive sizes, EXIF for photo metadata, Intl for locale-aware operations, -and a production-sized PHP OPcache. Timestamp checks remain enabled so edits -made through the browser-based development container and WordPress updates on -the shared CephFS volume become visible without restarting Apache. +The image enables PostgreSQL and PDO PostgreSQL, GD and Imagick for image +processing and responsive sizes, EXIF for photo metadata, Iconv and Intl for +text and locale handling, and a production-sized PHP OPcache. Timestamp checks +remain enabled so edits made through the browser-based development container +and WordPress updates on the shared CephFS volume become visible without +restarting Apache. Apache exposes extended `mod_status` data only on pod-local loopback port 8080. The Helm chart can add an Apache exporter sidecar, a `ServiceMonitor`, and diff --git a/imagick.ini b/imagick.ini new file mode 100644 index 0000000..76225ec --- /dev/null +++ b/imagick.ini @@ -0,0 +1 @@ +extension=imagick