Added expires apache mod + php settings

This commit is contained in:
Andy Miller 2018-09-20 21:24:38 -06:00
parent bddde74c50
commit a75614edd7
No known key found for this signature in database
GPG Key ID: E82B8D0EAB94EFB9
1 changed files with 18 additions and 2 deletions

View File

@ -1,8 +1,8 @@
FROM php:7.2-apache
LABEL maintainer="Andy Miller <rhuk@getgrav.org> (@rhukster)"
# Enable Apache Rewrite Module
RUN a2enmod rewrite
# Enable Apache Rewrite + Expires Module
RUN a2enmod rewrite expires
# Install dependencies
RUN apt-get update && apt-get install -y \
@ -16,6 +16,22 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'upload_max_filesize=128M'; \
echo 'post_max_size=128M'; \
} > /usr/local/etc/php/conf.d/php-recommended.ini
# provide container inside image for data persistance
# VOLUME /var/www/html
RUN pecl install apcu \
&& pecl install yaml \
&& docker-php-ext-enable apcu yaml