now php:7.3 + fpm + alpine

This commit is contained in:
Hüseyin Mert 2019-11-07 22:02:50 +03:00 committed by GitHub
parent 59c8a62ada
commit 023bd700a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 13 deletions

View File

@ -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