diff --git a/.lagoon/Dockerfile b/.lagoon/Dockerfile index 82ef7fa8e..8c3123e2a 100644 --- a/.lagoon/Dockerfile +++ b/.lagoon/Dockerfile @@ -1,7 +1,7 @@ # ==================================================================================================== # BUILDER IMAGE # ==================================================================================================== -FROM uselagoon/node-18-builder as builder +FROM uselagoon/php-8.2-cli-drupal as builder ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 @@ -17,6 +17,21 @@ RUN --mount=type=cache,target=/tmp/cache pnpm fetch && \ # So we remove them now. find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + +# Install composer dependencies. +# They may contain directive definitions required by prep scripts. +WORKDIR /app/apps/cms +RUN apk add --no-cache git qpdf imagemagick icu-dev && \ + docker-php-ext-install intl && \ + docker-php-ext-enable intl +RUN composer config --global github-protocols https +COPY apps/cms/composer.* /app/apps/cms/ +COPY apps/cms/patches /app/apps/cms/patches +COPY apps/cms/scaffold /app/apps/cms/scaffold +ENV COMPOSER_HOME=/tmp/cache/composer +RUN --mount=type=cache,target=/tmp/cache composer install --no-dev + +WORKDIR /app + # Copy the all package sources, install and prepare them. COPY . /app RUN --mount=type=cache,target=/tmp/cache pnpm i && \ @@ -36,14 +51,6 @@ FROM uselagoon/php-8.2-cli-drupal as cli RUN apk add --no-cache git qpdf imagemagick icu-dev && \ docker-php-ext-install intl && \ docker-php-ext-enable intl -RUN composer config --global github-protocols https - -COPY --from=builder /tmp/.deploy/cms/composer.json /app/composer.json -COPY --from=builder /tmp/.deploy/cms/composer.lock /app/composer.lock -COPY --from=builder /tmp/.deploy/cms/scaffold /app/scaffold -COPY --from=builder /tmp/.deploy/cms/patches /app/patches -ENV COMPOSER_HOME=/tmp/cache/composer -RUN --mount=type=cache,target=/tmp/cache composer install --no-dev COPY --from=builder /tmp/.deploy/cms /app