Skip to content

Commit 3da0772

Browse files
committed
Add production-type php.ini
1 parent 4f80e08 commit 3da0772

File tree

3 files changed

+1955
-6
lines changed

3 files changed

+1955
-6
lines changed

Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
ARG WP_VERSION=5.4-php7.3
2-
32
FROM wordpress:$WP_VERSION-fpm-alpine
4-
53
MAINTAINER RiotKit <riotkit@riseup.net>
64

75
ARG RIOTKIT_IMAGE_VERSION=""
8-
ENV AUTO_UPDATE_CRON="0 5 * * SAT"
96

10-
RUN apk --update add nginx supervisor \
7+
ENV AUTO_UPDATE_CRON="0 5 * * SAT" \
8+
PHP_DISPLAY_ERRORS="Off" \
9+
PHP_ERROR_REPORTING="E_ALL & ~E_DEPRECATED & ~E_STRICT"
10+
11+
RUN apk --update add nginx supervisor python3 py3-pip \
1112
&& curl "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar" --output /usr/bin/wp \
12-
&& mkdir -p /var/tmp/nginx/ \
13-
&& chown www-data:www-data /var/tmp/nginx/ -R
13+
&& mkdir -p /var/tmp/nginx/ /var/lib/nginx/tmp/ \
14+
&& chown www-data:www-data /var/tmp/nginx/ /var/lib/nginx/tmp/ -R \
15+
&& pip3 install j2cli
1416

1517
ADD etc/supervisor.conf /etc/supervisor.conf
1618
ADD etc/nginx/nginx.conf /etc/nginx/nginx.conf
1719
ADD ./wp-config-sample.php /usr/src/wordpress/wp-config-sample.php
1820
ADD ./update-wordpress.sh /usr/local/bin/update-wordpress.sh
1921
ADD ./entrypoint-wp.sh /entrypoint-wp.sh
22+
ADD ./usr /templates/usr
2023

2124
ENTRYPOINT ["/bin/bash", "/entrypoint-wp.sh"]

entrypoint-wp.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
set -e
4+
5+
setup_php_ini() {
6+
j2 /templates/usr/local/etc/php/php.ini.j2 > /usr/local/etc/php/php.ini
7+
}
8+
39
setup_crontab() {
410
echo "${AUTO_UPDATE_CRON} /bin/bash /usr/local/bin/update-wordpress.sh" > /etc/crontabs/root
511
}
@@ -18,6 +24,7 @@ install_wordpress() {
1824
mv /usr/local/sbin/php-fpm.bckp /usr/local/sbin/php-fpm
1925
}
2026

27+
setup_php_ini
2128
setup_crontab
2229
install_wordpress
2330
exec supervisord -c /etc/supervisor.conf

0 commit comments

Comments
 (0)