From 023bd700a08fd4bcfe9cf613e9a378cf82f0afb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Mert?= Date: Thu, 7 Nov 2019 22:02:50 +0300 Subject: [PATCH] now php:7.3 + fpm + alpine --- Dockerfile | 62 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e0f6eb..3a17a2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,59 @@ -FROM php:apache +FROM php:7.3-fpm-alpine -RUN apt-get update && apt-get install -y zip libzip-dev libpng-dev \ - && docker-php-ext-install pdo_mysql gd zip \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + curl-dev \ + imagemagick-dev \ + libtool \ + libxml2-dev \ + postgresql-dev \ + sqlite-dev \ + && apk add --no-cache \ + curl \ + git \ + gd \ + imagemagick \ + mysql-client \ + postgresql-libs \ + libintl \ + icu \ + icu-dev \ + libzip-dev \ + && pecl install imagick \ + && docker-php-ext-enable imagick \ + && apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \ + docker-php-ext-configure gd \ + --with-gd \ + --with-freetype-dir=/usr/include/ \ + --with-png-dir=/usr/include/ \ + --with-jpeg-dir=/usr/include/ && \ + NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \ + docker-php-ext-install -j${NPROC} gd && \ + apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev \ + && docker-php-ext-install \ + bcmath \ + curl \ + iconv \ + mbstring \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + pdo_sqlite \ + pcntl \ + tokenizer \ + xml \ + zip \ + intl \ + && apk del -f .build-deps -# Composer installation. COPY --from=composer:latest /usr/bin/composer /usr/bin/composer -# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser ENV COMPOSER_ALLOW_SUPERUSER=1 RUN composer global require hirak/prestissimo --prefer-dist --no-progress --no-suggest --classmap-authoritative \ && composer clear-cache ENV PATH="${PATH}:/root/.composer/vendor/bin" -COPY . /var/www/html/ - +WORKDIR /var/www/html +RUN mkdir -p storage bootstrap/cache # Authorize these folders to be edited -RUN chmod -R 777 /var/www/html/storage -RUN chmod -R 777 /var/www/html/bootstrap/cache - -# Allow rewrite -RUN a2enmod rewrite +RUN chmod -R 777 storage bootstrap/cache