This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
56 lines (50 loc) · 2.19 KB
/
Dockerfile
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
FROM php:7.1-fpm-alpine
LABEL maintainer "Keng Susumpow"
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Wordpress-FPM" \
org.label-schema.description="A Docker container for latest version of PHP-FPM and Wordpress." \
org.label-schema.url="https://www.opendream.co.th/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/opendream/wordpress-fpm" \
org.label-schema.vendor="Opendream Co., Ltd." \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
ENV WP_ROOT /usr/src/wordpress
ENV WP_VERSION 4.7.5
ENV WP_SHA1 fbe0ee1d9010265be200fe50b86f341587187302
ENV WP_DOWNLOAD_URL https://wordpress.org/wordpress-$WP_VERSION.tar.gz
RUN apk add --no-cache --virtual .build-deps \
autoconf build-base gcc imagemagick-dev libc-dev pcre-dev \
libjpeg-turbo-dev libpng-dev libtool make \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mysqli opcache \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& find /usr/local/lib/php/extensions -name '*.a' -delete \
&& find /usr/local/lib/php/extensions -name '*.so' -exec strip --strip-all '{}' \; \
&& runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .phpext-rundeps $runDeps \
&& apk del .build-deps
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
RUN curl -o wordpress.tar.gz -SL $WP_DOWNLOAD_URL \
&& echo "$WP_SHA1 *wordpress.tar.gz" | sha1sum -c - \
&& tar -xzf wordpress.tar.gz -C /usr/src/ \
&& rm wordpress.tar.gz