Skip to content

Commit ef064e4

Browse files
committed
Merge pull request docker-library#103 from zyrill/master
Add opcache, redis extensions and set reasonable config values
2 parents 6f4a444 + 282d0fd commit ef064e4

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

apache/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ RUN a2enmod rewrite
55
# install the PHP extensions we need
66
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev && rm -rf /var/lib/apt/lists/* \
77
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
8-
&& docker-php-ext-install gd
9-
RUN docker-php-ext-install mysqli
8+
&& docker-php-ext-install gd mysqli opcache
9+
10+
# set recommended PHP.ini settings
11+
# see https://secure.php.net/manual/en/opcache.installation.php
12+
RUN { \
13+
echo 'opcache.memory_consumption=128'; \
14+
echo 'opcache.interned_strings_buffer=8'; \
15+
echo 'opcache.max_accelerated_files=4000'; \
16+
echo 'opcache.revalidate_freq=60'; \
17+
echo 'opcache.fast_shutdown=1'; \
18+
echo 'opcache.enable_cli=1'; \
19+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
1020

1121
VOLUME /var/www/html
1222

fpm/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ FROM php:5.6-fpm
33
# install the PHP extensions we need
44
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev && rm -rf /var/lib/apt/lists/* \
55
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
6-
&& docker-php-ext-install gd
7-
RUN docker-php-ext-install mysqli
6+
&& docker-php-ext-install gd mysqli opcache
7+
8+
# set recommended PHP.ini settings
9+
# see https://secure.php.net/manual/en/opcache.installation.php
10+
RUN { \
11+
echo 'opcache.memory_consumption=128'; \
12+
echo 'opcache.interned_strings_buffer=8'; \
13+
echo 'opcache.max_accelerated_files=4000'; \
14+
echo 'opcache.revalidate_freq=60'; \
15+
echo 'opcache.fast_shutdown=1'; \
16+
echo 'opcache.enable_cli=1'; \
17+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
818

919
VOLUME /var/www/html
1020

0 commit comments

Comments
 (0)