From b1ef8e2e97caece56dc87ada4617f1d970e66b22 Mon Sep 17 00:00:00 2001 From: Alexander Sosna Date: Mon, 24 Aug 2020 15:45:08 +0200 Subject: [PATCH] Implement essential php.ini configuration via ENV Signed-off-by: Alexander Sosna --- docker-entrypoint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index bee572c2..e0a2c8ba 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -43,6 +43,13 @@ file_env() { unset "$fileVar" } +# Get essential PHP_INI configuration +file_env PHP_INI_MEMORY_LIMIT 512M + +# Set essential PHP_INI configuration +# It is important to set essential variables like 'memory-limit' before the first start to premvent OOM during installation and statup. +echo "memory_limit=${PHP_INI_MEMORY_LIMIT}" > /usr/local/etc/php/conf.d/memory-limit.ini; + if expr "$1" : "apache" 1>/dev/null; then if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then a2disconf remoteip