/
Dockerfile
48 lines (42 loc) · 1.71 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
FROM php:7-fpm-alpine
# Install packages and php extensions
RUN apk upgrade --update && apk add --no-cache \
autoconf file g++ gcc binutils isl libatomic libc-dev musl-dev make re2c libstdc++ libgcc binutils-libs mpc1 mpfr3 gmp libgomp \
bash \
sudo \
less \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libmcrypt-dev \
libpng-dev \
mysql-client \
&& docker-php-ext-install iconv mcrypt mysqli mysqlnd pdo pdo_mysql zip opcache \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& apk del autoconf file g++ gcc binutils isl libatomic libc-dev musl-dev make re2c libstdc++ libgcc binutils-libs mpc1 mpfr3 gmp libgomp \
&& rm -rf /var/cache/apk/*
# Set custom PHP overrides
RUN { \
echo 'upload_max_filesize=64M'; \
echo 'post_max_size=64M'; \
echo 'cgi.fix_pathinfo=0'; \
} > /usr/local/etc/php/conf.d/.user.ini
# Set recommended opcache settings
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
# Add WP-CLI
RUN curl -o /bin/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
COPY wp-su.sh /bin/wp
RUN chmod +x /bin/wp-cli.phar && chmod +x /bin/wp
WORKDIR /usr/share/nginx/html
# Set entrypoint script
COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]