-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-for-fpm
More file actions
82 lines (73 loc) · 1.6 KB
/
Dockerfile-for-fpm
File metadata and controls
82 lines (73 loc) · 1.6 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM alpine:3.11
LABEL Maintainer="George Zhou<alpha-coding@outlook.com >" \
Description="PHP-PFM Docker image based on Alpine Linux." \
Language="php7" \
OS="Alpine Linux" \
Service="PHP-FPM" \
Content="php7.3 apline3.11"
# ensure www-data user exists
RUN set -eux; \
addgroup -g 82 -S www-data; \
adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
RUN apk update && \
apk --no-cache add \
# official php-fpm packages
curl \
openssl \
tar \
xz \
zlib \
sqlite-libs \
libsodium \
bash \
php \
php-fpm \
# wordpress required php extensions
# graphic libraries for media
imagemagick-dev \
#less \
php7-fpm \
php7-mysqli \
php7-json \
php7-openssl \
php7-curl \
php7-zlib \
php7-xml \
php7-phar \
php7-intl \
php7-dom \
php7-xmlreader \
php7-xmlwriter \
php7-exif \
php7-fileinfo \
php7-sodium \
php7-gd \
php7-imagick \
php7-simplexml \
php7-ctype \
php7-mbstring \
php7-zip \
php7-pdo_mysql \
# optional
spl \
php7-opcache \
php7-iconv \
# for optimization using redis-cache plugin
php7-pecl-redis \
&& rm -rf /var/cache/apk/*
# Configure PHP-FPM
COPY docker-config/fpm-pool.conf /etc/php7/php-fpm.d/zz_docker.conf
COPY docker-config/php.ini /etc/php7/conf.d/zz_php.ini
# wordpress volume
VOLUME /var/www/html
WORKDIR /var/www/html
RUN chown -R www-data.www-data /var/www
RUN mkdir -p /usr/src \
&& chown -R www-data.www-data /usr/src
# Entrypoint
COPY entrypoint-for-fpm.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
EXPOSE 9000
CMD ["php-fpm7"]