make PHP worker process and memory limits configurable

testing-php81
Andrew Dolgov 3 years ago
parent adfe0ab121
commit 731725fb4e

@ -28,6 +28,9 @@ ADD config.docker.php ${SCRIPT_ROOT}
ENV OWNER_UID=1000
ENV OWNER_GID=1000
ENV PHP_WORKER_MAX_CHILDREN=5
ENV PHP_WORKER_MEMORY_LIMIT=256M
# don't try to update local plugins on startup (except for nginx_xaccel)
ENV TTRSS_NO_STARTUP_PLUGIN_UPDATES=""

@ -120,4 +120,10 @@ rm -f /tmp/error.log && mkfifo /tmp/error.log && chown app:app /tmp/error.log
touch $DST_DIR/.app_is_ready
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
/etc/php8/php.ini
sed -i.bak "s/^\(pm.max_children\) = \(.*\)/\1 = ${PHP_WORKER_MAX_CHILDREN}/" \
/etc/php8/php-fpm.d/www.conf
exec /usr/sbin/php-fpm8 --nodaemonize --force-stderr -R

Loading…
Cancel
Save