diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e0a2c8ba..9e3ddc10 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -48,7 +48,8 @@ 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; +file_memory_limit=/usr/local/etc/php/conf.d/memory-limit.ini +[ -s ${file_memory_limit} ] || echo "memory_limit=${PHP_INI_MEMORY_LIMIT}" > ${file_memory_limit} if expr "$1" : "apache" 1>/dev/null; then if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then