diff --git a/.github/workflows/nextcloud-update.yml b/.github/workflows/nextcloud-update.yml index bbe74f63..234661c8 100644 --- a/.github/workflows/nextcloud-update.yml +++ b/.github/workflows/nextcloud-update.yml @@ -58,7 +58,7 @@ jobs: | sort -V \ | tail -1 )" - sed -i "s|pecl install imagick.*|pecl install imagick-$imagick_version >/dev/null|" ./Containers/nextcloud/start.sh + sed -i "s|pecl install imagick.*\;|pecl install imagick-$imagick_version\;|" ./Containers/nextcloud/Dockerfile # Nextcloud NC_MAJOR="$(grep "ENV NEXTCLOUD_VERSION" ./Containers/nextcloud/Dockerfile | grep -oP '[23][0-9]')" diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index 3be622f5..0e581711 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -41,6 +41,16 @@ RUN set -ex; \ postgresql-dev \ libwebp-dev \ gmp-dev \ + lcms2-dev \ + fontconfig-dev \ + freetype-dev \ + ghostscript-dev \ + tiff-dev \ + zlib-dev \ + imagemagick-dev \ + libheif-dev \ + librsvg-dev \ + libxext-dev \ ; \ \ docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ @@ -62,6 +72,7 @@ RUN set -ex; \ pecl install APCu-5.1.22; \ pecl install memcached-3.2.0; \ pecl install redis-5.3.7; \ + pecl install imagick-3.7.0; \ \ docker-php-ext-enable \ apcu \ diff --git a/Containers/nextcloud/start.sh b/Containers/nextcloud/start.sh index f5b0f8bf..2513f52a 100644 --- a/Containers/nextcloud/start.sh +++ b/Containers/nextcloud/start.sh @@ -57,39 +57,25 @@ if [ -n "$ADDITIONAL_PHP_EXTENSIONS" ]; then if ! [ -f "/additional-php-extensions-are-installed" ]; then read -ra ADDITIONAL_PHP_EXTENSIONS_ARRAY <<< "$ADDITIONAL_PHP_EXTENSIONS" for app in "${ADDITIONAL_PHP_EXTENSIONS_ARRAY[@]}"; do + if [ "$app" = imagick ]; then + echo "Enabling Imagick..." + if ! docker-php-ext-enable imagick >/dev/null; then + echo "Could not install PHP extension imagick!" + fi + continue + fi # shellcheck disable=SC2086 if [ "$PHP_DEPS_ARE_INSTALLED" != 1 ]; then echo "Installing PHP build dependencies..." if ! apk add --no-cache --virtual .build-deps \ - lcms2-dev \ - libheif-dev \ - librsvg-dev \ - libxext-dev \ libxml2-dev \ - lcms2-dev \ - fontconfig-dev \ - freetype-dev \ - ghostscript-dev \ - lcms2-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - libtool \ - tiff-dev \ - zlib-dev \ - imagemagick-dev \ autoconf \ $PHPIZE_DEPS >/dev/null; then echo "Could not install build-deps!" fi PHP_DEPS_ARE_INSTALLED=1 fi - if [ "$app" = imagick ]; then - echo "Installing Imagick via PECL..." - pecl install imagick-3.7.0 >/dev/null - if ! docker-php-ext-enable imagick >/dev/null; then - echo "Could not install PHP extension imagick!" - fi - elif [ "$app" = inotify ]; then + if [ "$app" = inotify ]; then echo "Installing $app via PECL..." pecl install "$app" >/dev/null if ! docker-php-ext-enable "$app" >/dev/null; then