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
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,25 @@ jobs:
--build-arg DEBIAN_VERSION="${{ matrix.distro }}" \
.

# Verify core extensions are loaded in all flavors
docker run --rm pimcore-image php -m | grep -Fx 'amqp'
docker run --rm pimcore-image php -m | grep -Fx 'bcmath'
docker run --rm pimcore-image php -m | grep -Fx 'exif'
docker run --rm pimcore-image php -m | grep -Fx 'gd'
docker run --rm pimcore-image php -m | grep -Fx 'intl'
docker run --rm pimcore-image php -m | grep -Fx 'pcntl'
docker run --rm pimcore-image php -m | grep -Fx 'pdo_mysql'
docker run --rm pimcore-image php -m | grep -Fx 'sockets'
docker run --rm pimcore-image php -m | grep -Fx 'zip'

if [ "$imageVariant" != "min" ]; then
# Test that Imagick is installed
docker run --rm pimcore-image sh -c 'php -m | grep imagick'
fi

if [ "$imageVariant" == "max" ]; then
docker run --rm pimcore-image php -m | grep -Fx 'soap'
fi

if [ "$imageVariant" == "debug" ]; then
# Make sure xdebug is installed and configured on debug-build
Expand Down
108 changes: 27 additions & 81 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

ARG PHP_VERSION="8.5"
ARG DEBIAN_VERSION="trixie"
ARG PHP_EXTENSION_INSTALLER_VERSION="2.11.1"

FROM mlocati/php-extension-installer:${PHP_EXTENSION_INSTALLER_VERSION} AS php_extension_installer

FROM php:${PHP_VERSION}-fpm-${DEBIAN_VERSION} AS pimcore_php_min

ARG DEBIAN_VERSION

COPY --chmod=0755 files/build-*.sh /usr/local/bin/

RUN set -eux; \
\
echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries; \
DPKG_ARCH="$(dpkg --print-architecture)"; \
echo "deb http://deb.debian.org/debian ${DEBIAN_VERSION}-backports main" > /etc/apt/sources.list.d/backports.list; \
apt-get update; \
apt-get upgrade -y; \
Expand All @@ -22,41 +22,20 @@ RUN set -eux; \
iproute2 \
unzip \
; \
\
# dependencies for building PHP extensions
apt-get install -y \
libicu-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
zlib1g-dev \
librabbitmq-dev \
; \
\
docker-php-ext-configure gd --enable-gd --with-jpeg; \
docker-php-ext-configure pcntl --enable-pcntl; \
docker-php-ext-install \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

RUN --mount=type=bind,from=php_extension_installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions \
Comment thread
bluvulture marked this conversation as resolved.
amqp \
Comment thread
bluvulture marked this conversation as resolved.
bcmath \
exif \
gd \
intl \
pcntl \
pdo_mysql \
sockets \
zip \
; \
\
pecl install -f \
amqp \
; \
docker-php-ext-enable \
amqp \
; \
build-cleanup.sh; \
\
ldconfig /usr/local/lib; \
\
sync
zip

Comment thread
bluvulture marked this conversation as resolved.
COPY files/conf/php/php.ini /usr/local/etc/php/conf.d/20-pimcore.ini
COPY files/conf/php-fpm/php-fpm.conf /usr/local/etc/php-fpm.d/zz-www.conf
Expand Down Expand Up @@ -102,9 +81,6 @@ ARG DEBIAN_VERSION

RUN set -eux; \
\
build-install.sh; \
\
DPKG_ARCH="$(dpkg --print-architecture)"; \
apt-get update; \
\
# tools used by Pimcore
Expand All @@ -123,77 +99,47 @@ RUN set -eux; \
webp \
; \
\
# dependencies for building PHP extensions
apt-get install -y \
libfreetype6-dev \
libwebp-dev \
; \
\
# ImageMagick
apt-get install -y \
imagemagick \
libmagickwand-dev \
; \
\
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-install gd; \
\
pecl install -f \
apcu \
imagick \
redis \
; \
docker-php-ext-enable \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

RUN --mount=type=bind,from=php_extension_installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions \
apcu \
imagick \
redis \
; \
\
build-cleanup.sh; \
\
ldconfig /usr/local/lib; \
\
sync
redis

CMD ["php-fpm"]

FROM pimcore_php_default AS pimcore_php_max

RUN set -eux; \
\
build-install.sh; \
\
apt-get update; \
apt-get install -y \
chromium-sandbox \
libkrb5-dev \
libreoffice \
libxml2-dev \
openssl \
; \
\
docker-php-ext-install \
soap \
; \
docker-php-ext-enable \
soap \
; \
\
build-cleanup.sh; \
\
sync
apt-get clean; \
rm -rf /var/lib/apt/lists/*

RUN --mount=type=bind,from=php_extension_installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions \
soap

CMD ["php-fpm"]

FROM pimcore_php_default AS pimcore_php_debug

RUN --mount=type=bind,from=php_extension_installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions \
xdebug

RUN set -eux; \
\
build-install.sh; \
\
pecl install xdebug; \
docker-php-ext-enable xdebug; \
\
build-cleanup.sh; \
\
# For local development, it should be possible to use any local (Git) Composer repository - that's safe in debug image flavor
git config --global --add safe.directory "*"; \
Expand Down
9 changes: 0 additions & 9 deletions files/build-cleanup.sh

This file was deleted.

5 changes: 0 additions & 5 deletions files/build-install.sh

This file was deleted.

Loading