-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (59 loc) · 2.36 KB
/
Dockerfile
File metadata and controls
68 lines (59 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM php:7.4-fpm
WORKDIR /var/www
##########################################################################
#
# WARNING: This file was generated by update.php.
#
# You can find the relevant template in the `/templates` folder.
#
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_HOME=/tmp
# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libheif-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get upgrade openssl -y; \
update-ca-certificates --fresh; \
sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \
locale-gen; \
\
docker-php-ext-configure gd --with-jpeg=/usr --with-webp=/usr; \
\
docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \
\
pecl install xdebug-3.1.6; \
pecl install memcached-3.3.0; \
pecl install imagick; \
docker-php-ext-enable imagick; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;
COPY entrypoint.sh /entrypoint.sh
COPY common.sh /common.sh
COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf
ARG imagemagic_config=/etc/ImageMagick-6/policy.xml
RUN if [ -f $imagemagic_config ] ; then \
sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read|write" pattern="PDF" \/>/g' $imagemagic_config; \
else \
echo did not see file $imagemagic_config; \
fi
RUN chmod +x /entrypoint.sh && \
chmod +x /common.sh && \
groupadd -g 1000 -r wp_php && \
useradd -u 1000 -s /bin/bash -g wp_php wp_php
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "php-fpm" ]