Skip to content

Commit

Permalink
Merge pull request #104 from kool-dev/webp_support
Browse files Browse the repository at this point in the history
Adding WebP Support
  • Loading branch information
dbpolito authored Oct 29, 2024
2 parents aed55f2 + 001fbcb commit 835d277
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 45 deletions.
4 changes: 2 additions & 2 deletions 8.0-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand Down
4 changes: 2 additions & 2 deletions 8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand Down
4 changes: 2 additions & 2 deletions 8.1-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand Down
4 changes: 2 additions & 2 deletions 8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand Down
4 changes: 2 additions & 2 deletions 8.2-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand Down
4 changes: 2 additions & 2 deletions 8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand Down
14 changes: 4 additions & 10 deletions 8.3-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand All @@ -57,14 +57,8 @@ RUN adduser -D -u 1337 kool \
mysqli \
ftp \
&& pecl install redis \
&& mkdir /tmp/imagick && cd /tmp/imagick \
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/7088edc353f53c4bc644573a79cdcd67a726ae16.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
# composer
Expand Down
14 changes: 4 additions & 10 deletions 8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN adduser -D -u 1337 kool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
Expand All @@ -59,14 +59,8 @@ RUN adduser -D -u 1337 kool \
&& pecl install redis \
&& pecl install xdebug \
&& pecl install pcov && docker-php-ext-enable pcov \
&& mkdir /tmp/imagick && cd /tmp/imagick \
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/7088edc353f53c4bc644573a79cdcd67a726ae16.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
# composer
Expand Down
15 changes: 2 additions & 13 deletions template/Dockerfile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev {{ version_compare($version, '7.4', '>=') ? 'oniguruma-dev' : '' }} \
imagemagick-dev openldap-dev {{ version_compare($version, '7.4', '>=') ? 'oniguruma-dev' : '' }} libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
@if (version_compare($version, '7.4', '>='))
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
@else
&& docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
Expand Down Expand Up @@ -73,19 +73,8 @@
&& pecl install {{ version_compare($version, '8', '>=') ? 'xdebug' : 'xdebug-3.1.6' }} \
&& pecl install pcov && docker-php-ext-enable pcov \
@endif
@if (version_compare($version, '8.2', '<='))
&& pecl install imagick \
&& docker-php-ext-enable imagick \
@else
&& mkdir /tmp/imagick && cd /tmp/imagick \
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/7088edc353f53c4bc644573a79cdcd67a726ae16.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
@endif
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-{{ $prod ? 'production' : 'development' }}" "/usr/local/etc/php/php.ini" \
# composer
Expand Down

0 comments on commit 835d277

Please sign in to comment.