From 0ca6de18d724898df1fa64febe813bfe2202c57f Mon Sep 17 00:00:00 2001 From: Ivan Rey De Cardo Date: Thu, 7 Oct 2021 22:37:57 +0800 Subject: [PATCH 1/2] Update to 8.0-alpine --- Dockerfile | 64 +++++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a3e7da..edf57f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,23 @@ -FROM php:alpine +ARG PHP_VERSION=8.0 -ENV COMPOSER_ALLOW_SUPERUSER=1 \ - PATH="./vendor/bin:$PATH" +FROM php:$PHP_VERSION-alpine RUN apk add --update --no-cache \ - bash \ - openssh-client \ - rsync + bash openssh-client rsync -RUN apk add --update --no-cache -t .persistent-deps \ - # for bz2 extension - bzip2-dev \ - # for gd --with-freetype-dir option - freetype-dev \ - # for gmp extension - gmp-dev \ - # for gd --with-jpeg-dir option - libjpeg-turbo-dev \ - # for gd --with-png-dir option - libpng-dev \ - # for zip extension - libzip-dev \ - # Environment - && set -xe \ - # Configure - && docker-php-ext-configure gd \ - --with-freetype-dir=/usr/include \ - --with-jpeg-dir=/usr/include \ - --with-png-dir=/usr/include \ - && docker-php-ext-configure zip \ - --with-libzip \ - && docker-php-ext-install \ - bcmath \ - bz2 \ - exif \ - gd \ - gmp \ - pdo_mysql \ - zip \ - # Composer - && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin --filename=composer \ - # Cleanup - && apk del --no-cache \ - freetype-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - && rm -rf \ - /tmp/* \ - /var/cache/apk/* \ - /var/tmp/* +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + +RUN chmod +x /usr/local/bin/install-php-extensions && \ + install-php-extensions \ + @composer \ + bcmath-$PHP_VERSION \ + bz2-$PHP_VERSION \ + exif-$PHP_VERSION \ + gd-$PHP_VERSION \ + gmp-$PHP_VERSION \ + pdo_mysql-$PHP_VERSION \ + zip-$PHP_VERSION + +RUN rm -rf /tmp/* /var/cache/apk/* /var/tmp/* WORKDIR /var/www From e520b1903263db0fb1d02c28bf7d048441e71cf8 Mon Sep 17 00:00:00 2001 From: Ivan Rey De Cardo Date: Thu, 14 Oct 2021 01:01:14 +0800 Subject: [PATCH 2/2] Added npm --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index edf57f5..3c9d49b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG PHP_VERSION=8.0 FROM php:$PHP_VERSION-alpine RUN apk add --update --no-cache \ - bash openssh-client rsync + bash npm openssh-client rsync ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/