Repository navigation
Expand file tree
/
Copy pathContainerfile.fpm
More file actions
113 lines (98 loc) · 3.37 KB
/
Copy pathContainerfile.fpm
File metadata and controls
113 lines (98 loc) · 3.37 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
ARG FREEBSD_RELEASE
ARG PHPVER
FROM ghcr.io/appjail-makejails/php:${FREEBSD_RELEASE}-${PHPVER}
ARG NO_PKGCLEAN
LABEL org.opencontainers.image.title="WordPress" \
org.opencontainers.image.description="State-of-the-art semantic personal publishing platform" \
org.opencontainers.image.source="https://github.com/AppJail-makejails/wordpress" \
org.opencontainers.image.url="https://github.com/AppJail-makejails/wordpress" \
org.opencontainers.image.vendor="DtxdF" \
org.opencontainers.image.authors="Jesús Daniel Colmenares Oviedo <dtxdf@disroot.org>"
ARG PHPVER
RUN set -xe; \
\
umask 0022; \
\
pkg update; \
pkg install wordpress gsed bash gtar gawk; \
\
if [ -z "${NO_PKGCLEAN}" ]; then \
pkg clean -a; \
rm -rf /var/cache/pkg/*; \
fi; \
rm -rf /var/db/pkg/repos/*; \
\
php_version=`php -r 'echo PHP_VERSION;' | sed -Ee 's/^([0-9]+)\.([0-9]+)\.[0-9]+$/\1\2/'`; \
\
if [ "${php_version}" != "${PHPVER}" ]; then \
echo "Installed PHP version is different from what expected ( ${php_version} != ${PHPVER} )"; \
exit 1; \
fi
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN set -eux; \
\
umask 0022; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
} > "/usr/local/etc/php/opcache-recommended.ini"
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
RUN set -eux; \
\
umask 0022; \
\
{ \
# https://www.php.net/manual/en/errorfunc.constants.php
# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670
echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \
echo 'display_errors = Off'; \
echo 'display_startup_errors = Off'; \
echo 'log_errors = On'; \
echo 'error_log = /dev/stderr'; \
echo 'log_errors_max_len = 1024'; \
echo 'ignore_repeated_errors = On'; \
echo 'ignore_repeated_source = Off'; \
echo 'html_errors = Off'; \
} > "/usr/local/etc/php/error-logging.ini"
RUN set -eux; \
\
umask 0022; \
\
# https://wordpress.org/support/article/htaccess/
[ ! -e /usr/src/wordpress/.htaccess ]; \
{ \
echo '# BEGIN WordPress'; \
echo ''; \
echo 'RewriteEngine On'; \
echo 'RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]'; \
echo 'RewriteBase /'; \
echo 'RewriteRule ^index\.php$ - [L]'; \
echo 'RewriteCond %{REQUEST_FILENAME} !-f'; \
echo 'RewriteCond %{REQUEST_FILENAME} !-d'; \
echo 'RewriteRule . /index.php [L]'; \
echo ''; \
echo '# END WordPress'; \
} > /usr/local/www/wordpress/.htaccess; \
\
mkdir -p /usr/local/www/wordpress/wp-content/cache; \
\
chown -R www:www /usr/local/www/wordpress; \
\
mkdir -p /usr/local/www/html; \
chown www:www /usr/local/www/html; \
chmod 755 /usr/local/www/html; \
\
rm -f /usr/local/www/wordpress/wp-config.php
VOLUME /usr/local/www/html
COPY wp-config-oci.php /usr/local/www/wordpress
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
# https://github.com/docker-library/wordpress/issues/969
RUN ln -svf entrypoint.sh /ensure-installed.sh
WORKDIR /usr/local/www/html
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm"]