From 7f02a77ecb1cf0dec519d9528c0a8e1e8e576bf0 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 24 Dec 2023 15:50:54 +0000 Subject: [PATCH] [docker] flatten build a bit --- Dockerfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14a868de..d25fe0ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,18 +2,22 @@ ARG PHP_VERSION=8.2 # Install base packages which all stages (build, test, run) need FROM debian:bookworm AS base -RUN apt update && apt upgrade -y -RUN apt update && apt install -y curl -RUN curl --output /usr/share/keyrings/nginx-keyring.gpg https://unit.nginx.org/keys/nginx-keyring.gpg -RUN echo 'deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/debian/ bookworm unit' > /etc/apt/sources.list.d/unit.list -RUN apt update && apt install -y \ +RUN apt update && \ + apt upgrade -y && \ + apt install -y curl && \ + curl --output /usr/share/keyrings/nginx-keyring.gpg https://unit.nginx.org/keys/nginx-keyring.gpg && \ + echo 'deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/debian/ bookworm unit' > /etc/apt/sources.list.d/unit.list && \ + apt update && apt install -y --no-install-recommends \ php${PHP_VERSION}-cli php${PHP_VERSION}-gd php${PHP_VERSION}-zip php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring \ php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-curl \ - curl imagemagick ffmpeg zip unzip git unit unit-php gettext procps net-tools vim + curl imagemagick ffmpeg zip unzip git unit unit-php gettext && \ + rm -rf /var/lib/apt/lists/* # Composer has 100MB of dependencies, and we only need that during build and test FROM base AS composer -RUN apt update && apt upgrade -y && apt install -y composer php${PHP_VERSION}-xdebug && rm -rf /var/lib/apt/lists/* +RUN apt update && apt upgrade -y && \ + apt install -y composer php${PHP_VERSION}-xdebug procps net-tools vim && \ + rm -rf /var/lib/apt/lists/* ENV XDEBUG_MODE=coverage # "Build" shimmie (composer install - done in its own stage so that we don't