-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-fpm.template
87 lines (76 loc) · 2 KB
/
Dockerfile-fpm.template
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM php:8.3-fpm
# install the PHP extensions we need
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
jq \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libjpeg-dev \
libmagickwand-dev \
libmemcached-dev \
libpng-dev \
libssl-dev \
libwebp-dev \
libzip-dev \
unzip \
zlib1g-dev \
; \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
; \
docker-php-ext-install -j $(nproc) \
bcmath \
exif \
gd \
intl \
mysqli \
opcache \
zip \
; \
pecl install \
apcu-5.1.23 \
igbinary-3.2.16 \
imagick-3.7.0 \
memcache-8.2 \
memcached-3.2.0 \
; \
docker-php-ext-enable \
apcu \
igbinary \
imagick \
memcache \
memcached \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
COPY wordpress.ini /usr/local/etc/php/conf.d/wordpress.ini
ENV WORDPRESS_VERSION %%WORDPRESS_VERSION%%
ENV WORDPRESS_SHA1 %%WORDPRESS_SHA1%%
RUN set -ex; \
curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \
echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c -; \
tar -xzf wordpress.tar.gz -C /usr/src/; \
rm wordpress.tar.gz; \
chown -R www-data:www-data /usr/src/wordpress
# install wp-config.php
COPY --chown=www-data:www-data ./wp-config.php /usr/src/wordpress
COPY install-* /usr/local/bin/
RUN mkdir -p /var/www/wp-content \
&& mkdir /var/www/wp-content/plugins \
&& mkdir /var/www/wp-content/themes \
&& install-github-dropin automattic/wp-memcached object-cache.php \
&& chown -R www-data:www-data /var/www
USER www-data
WORKDIR /var/www
RUN composer init -n --name wordpress/wordpress \
&& composer config --no-plugins allow-plugins.composer/installers true
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["php-fpm"]