Skip to content

Commit 1d53308

Browse files
authored
Merge pull request docker-library#403 from infosiftr/site-health
Update according to "Site Health" recommendations
2 parents 56a0ef5 + 9ee913e commit 1d53308

16 files changed

+238
-31
lines changed

Dockerfile-alpine.template

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,28 @@ RUN apk add --no-cache \
77
# BusyBox sed is not sufficient for some of our sed expressions
88
sed
99

10-
# install the PHP extensions we need
10+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
1111
RUN set -ex; \
1212
\
1313
apk add --no-cache --virtual .build-deps \
14+
$PHPIZE_DEPS \
15+
imagemagick-dev \
1416
libjpeg-turbo-dev \
1517
libpng-dev \
1618
libzip-dev \
1719
; \
1820
\
1921
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
20-
docker-php-ext-install gd mysqli opcache zip; \
22+
docker-php-ext-install \
23+
bcmath \
24+
exif \
25+
gd \
26+
mysqli \
27+
opcache \
28+
zip \
29+
; \
30+
pecl install imagick-3.4.4; \
31+
docker-php-ext-enable imagick; \
2132
\
2233
runDeps="$( \
2334
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \

Dockerfile-cli.template

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
FROM php:%%PHP_VERSION%%-alpine
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
apk add --no-cache --virtual .build-deps \
7+
$PHPIZE_DEPS \
8+
imagemagick-dev \
79
libjpeg-turbo-dev \
810
libpng-dev \
911
libzip-dev \
1012
; \
1113
\
1214
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
13-
docker-php-ext-install gd mysqli opcache zip; \
15+
docker-php-ext-install \
16+
bcmath \
17+
exif \
18+
gd \
19+
mysqli \
20+
opcache \
21+
zip \
22+
; \
23+
pecl install imagick-3.4.4; \
24+
docker-php-ext-enable imagick; \
1425
\
1526
runDeps="$( \
1627
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
@@ -31,6 +42,18 @@ RUN { \
3142
echo 'opcache.fast_shutdown=1'; \
3243
echo 'opcache.enable_cli=1'; \
3344
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
45+
# https://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Logging
46+
RUN { \
47+
echo 'error_reporting = 4339'; \
48+
echo 'display_errors = Off'; \
49+
echo 'display_startup_errors = Off'; \
50+
echo 'log_errors = On'; \
51+
echo 'error_log = /dev/stderr'; \
52+
echo 'log_errors_max_len = 1024'; \
53+
echo 'ignore_repeated_errors = On'; \
54+
echo 'ignore_repeated_source = Off'; \
55+
echo 'html_errors = Off'; \
56+
} > /usr/local/etc/php/conf.d/error-logging.ini
3457

3558
# install wp-cli dependencies
3659
RUN apk add --no-cache \

Dockerfile-debian.template

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
FROM php:%%PHP_VERSION%%-%%VARIANT%%
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
savedAptMark="$(apt-mark showmanual)"; \
77
\
88
apt-get update; \
99
apt-get install -y --no-install-recommends \
1010
libjpeg-dev \
11+
libmagickwand-dev \
1112
libpng-dev \
1213
libzip-dev \
1314
; \
1415
\
1516
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
16-
docker-php-ext-install gd mysqli opcache zip; \
17+
docker-php-ext-install \
18+
bcmath \
19+
exif \
20+
gd \
21+
mysqli \
22+
opcache \
23+
zip \
24+
; \
25+
pecl install imagick-3.4.4; \
26+
docker-php-ext-enable imagick; \
1727
\
1828
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
1929
apt-mark auto '.*' > /dev/null; \

generate-stackbrew-library.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
set -eu
33

44
# https://wordpress.org/about/requirements/
5-
defaultPhpVersion='php7.2'
5+
# https://wordpress.org/support/update-php/#before-you-update-your-php-version
6+
defaultPhpVersion='php7.3'
67
defaultVariant='apache'
78

89
self="$(basename "$BASH_SOURCE")"

php7.1/apache/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
FROM php:7.1-apache
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
savedAptMark="$(apt-mark showmanual)"; \
77
\
88
apt-get update; \
99
apt-get install -y --no-install-recommends \
1010
libjpeg-dev \
11+
libmagickwand-dev \
1112
libpng-dev \
1213
; \
1314
\
1415
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
15-
docker-php-ext-install gd mysqli opcache zip; \
16+
docker-php-ext-install \
17+
bcmath \
18+
exif \
19+
gd \
20+
mysqli \
21+
opcache \
22+
zip \
23+
; \
24+
pecl install imagick-3.4.4; \
25+
docker-php-ext-enable imagick; \
1626
\
1727
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
1828
apt-mark auto '.*' > /dev/null; \

php7.1/cli/Dockerfile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
FROM php:7.1-alpine
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
apk add --no-cache --virtual .build-deps \
7+
$PHPIZE_DEPS \
8+
imagemagick-dev \
79
libjpeg-turbo-dev \
810
libpng-dev \
911
; \
1012
\
1113
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
12-
docker-php-ext-install gd mysqli opcache zip; \
14+
docker-php-ext-install \
15+
bcmath \
16+
exif \
17+
gd \
18+
mysqli \
19+
opcache \
20+
zip \
21+
; \
22+
pecl install imagick-3.4.4; \
23+
docker-php-ext-enable imagick; \
1324
\
1425
runDeps="$( \
1526
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
@@ -30,6 +41,18 @@ RUN { \
3041
echo 'opcache.fast_shutdown=1'; \
3142
echo 'opcache.enable_cli=1'; \
3243
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
44+
# https://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Logging
45+
RUN { \
46+
echo 'error_reporting = 4339'; \
47+
echo 'display_errors = Off'; \
48+
echo 'display_startup_errors = Off'; \
49+
echo 'log_errors = On'; \
50+
echo 'error_log = /dev/stderr'; \
51+
echo 'log_errors_max_len = 1024'; \
52+
echo 'ignore_repeated_errors = On'; \
53+
echo 'ignore_repeated_source = Off'; \
54+
echo 'html_errors = Off'; \
55+
} > /usr/local/etc/php/conf.d/error-logging.ini
3356

3457
# install wp-cli dependencies
3558
RUN apk add --no-cache \

php7.1/fpm-alpine/Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,27 @@ RUN apk add --no-cache \
77
# BusyBox sed is not sufficient for some of our sed expressions
88
sed
99

10-
# install the PHP extensions we need
10+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
1111
RUN set -ex; \
1212
\
1313
apk add --no-cache --virtual .build-deps \
14+
$PHPIZE_DEPS \
15+
imagemagick-dev \
1416
libjpeg-turbo-dev \
1517
libpng-dev \
1618
; \
1719
\
1820
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
19-
docker-php-ext-install gd mysqli opcache zip; \
21+
docker-php-ext-install \
22+
bcmath \
23+
exif \
24+
gd \
25+
mysqli \
26+
opcache \
27+
zip \
28+
; \
29+
pecl install imagick-3.4.4; \
30+
docker-php-ext-enable imagick; \
2031
\
2132
runDeps="$( \
2233
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \

php7.1/fpm/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
FROM php:7.1-fpm
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
savedAptMark="$(apt-mark showmanual)"; \
77
\
88
apt-get update; \
99
apt-get install -y --no-install-recommends \
1010
libjpeg-dev \
11+
libmagickwand-dev \
1112
libpng-dev \
1213
; \
1314
\
1415
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
15-
docker-php-ext-install gd mysqli opcache zip; \
16+
docker-php-ext-install \
17+
bcmath \
18+
exif \
19+
gd \
20+
mysqli \
21+
opcache \
22+
zip \
23+
; \
24+
pecl install imagick-3.4.4; \
25+
docker-php-ext-enable imagick; \
1626
\
1727
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
1828
apt-mark auto '.*' > /dev/null; \

php7.2/apache/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
FROM php:7.2-apache
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
savedAptMark="$(apt-mark showmanual)"; \
77
\
88
apt-get update; \
99
apt-get install -y --no-install-recommends \
1010
libjpeg-dev \
11+
libmagickwand-dev \
1112
libpng-dev \
1213
; \
1314
\
1415
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
15-
docker-php-ext-install gd mysqli opcache zip; \
16+
docker-php-ext-install \
17+
bcmath \
18+
exif \
19+
gd \
20+
mysqli \
21+
opcache \
22+
zip \
23+
; \
24+
pecl install imagick-3.4.4; \
25+
docker-php-ext-enable imagick; \
1626
\
1727
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
1828
apt-mark auto '.*' > /dev/null; \

php7.2/cli/Dockerfile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
FROM php:7.2-alpine
22

3-
# install the PHP extensions we need
3+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
44
RUN set -ex; \
55
\
66
apk add --no-cache --virtual .build-deps \
7+
$PHPIZE_DEPS \
8+
imagemagick-dev \
79
libjpeg-turbo-dev \
810
libpng-dev \
911
; \
1012
\
1113
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
12-
docker-php-ext-install gd mysqli opcache zip; \
14+
docker-php-ext-install \
15+
bcmath \
16+
exif \
17+
gd \
18+
mysqli \
19+
opcache \
20+
zip \
21+
; \
22+
pecl install imagick-3.4.4; \
23+
docker-php-ext-enable imagick; \
1324
\
1425
runDeps="$( \
1526
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
@@ -30,6 +41,18 @@ RUN { \
3041
echo 'opcache.fast_shutdown=1'; \
3142
echo 'opcache.enable_cli=1'; \
3243
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
44+
# https://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Logging
45+
RUN { \
46+
echo 'error_reporting = 4339'; \
47+
echo 'display_errors = Off'; \
48+
echo 'display_startup_errors = Off'; \
49+
echo 'log_errors = On'; \
50+
echo 'error_log = /dev/stderr'; \
51+
echo 'log_errors_max_len = 1024'; \
52+
echo 'ignore_repeated_errors = On'; \
53+
echo 'ignore_repeated_source = Off'; \
54+
echo 'html_errors = Off'; \
55+
} > /usr/local/etc/php/conf.d/error-logging.ini
3356

3457
# install wp-cli dependencies
3558
RUN apk add --no-cache \

php7.2/fpm-alpine/Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,27 @@ RUN apk add --no-cache \
77
# BusyBox sed is not sufficient for some of our sed expressions
88
sed
99

10-
# install the PHP extensions we need
10+
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
1111
RUN set -ex; \
1212
\
1313
apk add --no-cache --virtual .build-deps \
14+
$PHPIZE_DEPS \
15+
imagemagick-dev \
1416
libjpeg-turbo-dev \
1517
libpng-dev \
1618
; \
1719
\
1820
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
19-
docker-php-ext-install gd mysqli opcache zip; \
21+
docker-php-ext-install \
22+
bcmath \
23+
exif \
24+
gd \
25+
mysqli \
26+
opcache \
27+
zip \
28+
; \
29+
pecl install imagick-3.4.4; \
30+
docker-php-ext-enable imagick; \
2031
\
2132
runDeps="$( \
2233
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \

0 commit comments

Comments
 (0)