add mysql dependency + fix routing
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
1d8ec91a4e
commit
972c0726db
107
Dockerfile
107
Dockerfile
@ -4,25 +4,26 @@ FROM eumau/nginx-unit:${UNIT_VERSION}-php7.3
|
|||||||
# set recommended PHP.ini settings
|
# set recommended PHP.ini settings
|
||||||
# see https://secure.php.net/manual/en/opcache.installation.php
|
# see https://secure.php.net/manual/en/opcache.installation.php
|
||||||
RUN { \
|
RUN { \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=128'; \
|
||||||
echo 'opcache.interned_strings_buffer=8'; \
|
echo 'opcache.interned_strings_buffer=8'; \
|
||||||
echo 'opcache.max_accelerated_files=4000'; \
|
echo 'opcache.max_accelerated_files=4000'; \
|
||||||
echo 'opcache.revalidate_freq=2'; \
|
echo 'opcache.revalidate_freq=2'; \
|
||||||
echo 'opcache.fast_shutdown=1'; \
|
echo 'opcache.fast_shutdown=1'; \
|
||||||
} > /etc/php/7.3/embed/conf.d/opcache-recommended.ini
|
} > /etc/php/7.3/embed/conf.d/opcache-recommended.ini
|
||||||
|
|
||||||
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
|
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
|
||||||
RUN { \
|
RUN { \
|
||||||
# https://www.php.net/manual/en/errorfunc.constants.php
|
# https://www.php.net/manual/en/errorfunc.constants.php
|
||||||
# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670
|
# 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 '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_errors = Off'; \
|
||||||
echo 'display_startup_errors = Off'; \
|
echo 'display_startup_errors = Off'; \
|
||||||
echo 'log_errors = On'; \
|
echo 'log_errors = On'; \
|
||||||
echo 'error_log = /dev/stderr'; \
|
echo 'error_log = /dev/stderr'; \
|
||||||
echo 'log_errors_max_len = 1024'; \
|
echo 'log_errors_max_len = 1024'; \
|
||||||
echo 'ignore_repeated_errors = On'; \
|
echo 'ignore_repeated_errors = On'; \
|
||||||
echo 'ignore_repeated_source = Off'; \
|
echo 'ignore_repeated_source = Off'; \
|
||||||
echo 'html_errors = Off'; \
|
echo 'html_errors = Off'; \
|
||||||
} > /etc/php/7.3/embed/conf.d/error-logging.ini
|
} > /etc/php/7.3/embed/conf.d/error-logging.ini
|
||||||
|
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
@ -31,6 +32,9 @@ ENV WORDPRESS_VERSION 5.2.3
|
|||||||
ENV WORDPRESS_SHA1 5efd37148788f3b14b295b2a9bf48a1a467aa303
|
ENV WORDPRESS_SHA1 5efd37148788f3b14b295b2a9bf48a1a467aa303
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
apt-get update && apt-get -y install --no-install-recommends \
|
||||||
|
php7.3-mysql \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* ; \
|
||||||
curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \
|
curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \
|
||||||
echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c -; \
|
echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c -; \
|
||||||
# upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress
|
# upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress
|
||||||
@ -42,46 +46,43 @@ RUN set -ex; \
|
|||||||
# port used by the listener in config.json
|
# port used by the listener in config.json
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# application setup
|
# launch and configure Unit
|
||||||
|
|
||||||
# launch Unit
|
|
||||||
RUN \
|
RUN \
|
||||||
[ -f /var/www/html/index.php ] || { \
|
-f /var/www/html/index.php ] || { \
|
||||||
touch /var/www/html/index.php /var/www/html/index.php.remove; \
|
touch /var/www/html/index.php /var/www/html/index.php.remove; \
|
||||||
} \
|
} \
|
||||||
&& unitd --control unix:/var/run/control.unit.sock \
|
&& unitd --control unix:/var/run/control.unit.sock \
|
||||||
# upload the app config to Unit
|
&& curl -X PUT --data-binary \
|
||||||
&& curl -X PUT --data-binary \
|
'{ \
|
||||||
'{ \
|
"listeners": { "*:8080": { "pass": "routes" } }, \
|
||||||
"listeners": { "*:8080": { "pass": "routes" } }, \
|
"routes": [ \
|
||||||
"routes": [ \
|
{ "match": { "uri": "*.php" }, "action": { "pass": "applications/direct_php" } }, \
|
||||||
{ "match": { "uri": "*.php" }, "action": { "pass": "applications/direct_php" } }, \
|
{ "match": { "uri": "!*/" }, "action": { "share": "/var/www/html" } }, \
|
||||||
{ "action": { "share": "/var/www/html" } }, \
|
{ "action": { "pass": "applications/index_php" } } \
|
||||||
{ "action": { "pass": "applications/index_php" } } \
|
], \
|
||||||
], \
|
"applications": { \
|
||||||
"applications": { \
|
"index_php": { \
|
||||||
"index_php": { \
|
"type": "php", \
|
||||||
"type": "php", \
|
"processes": { "max": 20, "spare": 5 }, \
|
||||||
"processes": { "max": 20, "spare": 5 }, \
|
"user": "www-data", \
|
||||||
"user": "www-data", \
|
"group": "www-data", \
|
||||||
"group": "www-data", \
|
"root": "/var/www/html", \
|
||||||
"root": "/var/www/html", \
|
"script": "index.php" \
|
||||||
"script": "index.php" \
|
}, \
|
||||||
}, \
|
"direct_php": { \
|
||||||
"direct_php": { \
|
"type": "php", \
|
||||||
"type": "php", \
|
"processes": { "max": 5, "spare": 0 }, \
|
||||||
"processes": { "max": 5, "spare": 0 }, \
|
"user": "www-data", \
|
||||||
"user": "www-data", \
|
"group": "www-data", \
|
||||||
"group": "www-data", \
|
"root": "/var/www/html", \
|
||||||
"root": "/var/www/html", \
|
"index": "index.php" \
|
||||||
"index": "index.php" \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
}' \
|
||||||
}' \
|
--unix-socket /var/run/control.unit.sock http://localhost/config/ \
|
||||||
--unix-socket /var/run/control.unit.sock http://localhost/config/ \
|
&& [ -f /var/www/html/index.php.remove ] && { \
|
||||||
&& [ -f /var/www/html/index.php.remove ] && { \
|
rm /var/www/html/index.php /var/www/html/index.php.remove; \
|
||||||
rm /var/www/html/index.php /var/www/html/index.php.remove; \
|
}
|
||||||
}
|
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user