From cc8e4589069783f52cca90ed9543a59bc7dc3913 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 11 Feb 2024 15:45:55 +0100 Subject: [PATCH] docker: split up application and dependency layers --- docker/php/Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 78e979d3..f70a05b9 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -2,8 +2,6 @@ FROM composer AS composer FROM php:8.1-fpm-bullseye -COPY --from=composer /usr/bin/composer /usr/bin/composer -COPY . /code RUN apt-get update && apt-get upgrade -y && apt-get install -y \ zlib1g-dev libicu-dev g++ \ @@ -36,8 +34,12 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \ && pecl install -o -f igbinary \ && docker-php-ext-install gd zip opcache intl pdo pdo_mysql mysqli bcmath gettext iconv mbstring curl \ && docker-php-ext-enable igbinary redis imagick \ - && useradd -MU leftypol \ - && /code/docker/common-setup.sh \ + && useradd -MU leftypol + +COPY --from=composer /usr/bin/composer /usr/bin/composer +COPY . /code + +RUN /code/docker/common-setup.sh \ && ln -s /code/composer.json /code/composer.lock /var/www-leftypol/ \ && cd /var/www-leftypol && composer install @@ -45,4 +47,4 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \ RUN /code/docker/common-setup.sh WORKDIR "/var/www-leftypol" CMD ["php-fpm"] -EXPOSE 9000 \ No newline at end of file +EXPOSE 9000