From f71b5cd76dde7e778349024b871da83a8bc62c47 Mon Sep 17 00:00:00 2001 From: Vaibhav Pandey Date: Wed, 3 Jul 2024 13:19:31 +0530 Subject: [PATCH] Skip repeated apt-get update & use node v20 --- Dockerfile | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac1e894..c8fc221 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,29 +7,24 @@ RUN apt-get update && \ apt-get install -y curl git zip # install basic extensions -RUN apt-get update && \ - apt-get install -y libxml2-dev && \ +RUN apt-get install -y libxml2-dev && \ docker-php-ext-install bcmath ctype exif fileinfo opcache pcntl pdo_mysql xml # install php-curl extension -RUN apt-get update && \ - apt-get install -y libcurl3-dev && \ +RUN apt-get install -y libcurl3-dev && \ docker-php-ext-install curl # install php-gd extension -RUN apt-get update && \ - apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev && \ +RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev && \ docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && \ docker-php-ext-install -j$(nproc) gd # install php-gmp extension -RUN apt-get update && \ - apt-get install -y libgmp-dev && \ +RUN apt-get install -y libgmp-dev && \ docker-php-ext-install gmp # install php-imagick extension -RUN apt-get update && \ - apt-get install -y libmagickwand-dev && \ +RUN apt-get install -y libmagickwand-dev && \ git clone https://github.com/Imagick/imagick.git --single-branch /tmp/imagick && \ cd /tmp/imagick && \ phpize && \ @@ -39,8 +34,7 @@ RUN apt-get update && \ docker-php-ext-enable imagick # install php-intl extension -RUN apt-get update && \ - apt-get -y install libicu-dev && \ +RUN apt-get -y install libicu-dev && \ docker-php-ext-configure intl && \ docker-php-ext-install intl @@ -54,19 +48,17 @@ ARG xdebugVersion RUN if [ ! -z "$xdebugVersion" ]; then pecl install xdebug-$xdebugVersion && docker-php-ext-enable xdebug; fi # install php-zip extension -RUN apt-get update && \ - apt-get install -y libzip-dev && \ +RUN apt-get install -y libzip-dev && \ docker-php-ext-install -j$(nproc) zip # install composer COPY --from=composer /usr/bin/composer /usr/bin/composer # install mysql client -RUN apt-get update && \ - apt-get install -y default-mysql-client +RUN apt-get install -y default-mysql-client # install Node.js and npm -RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs # install Yarn package manager