mirror of
https://github.com/nextcloud/docker.git
synced 2025-06-17 08:34:48 +02:00
Configure PHP memory_limit via environment variable
A new Docker environment variable named `PHP_MEMORY_LIMIT` has been introduced which allows the PHP `memory_limit` setting to be controlled without mounting any volumes from the host. The default memory limit is still `512M` if this variable is not specified. Signed-off-by: Robert Dailey <rcdailey@gmail.com>
This commit is contained in:
parent
783232840a
commit
f988290dc9
22 changed files with 109 additions and 22 deletions
|
@ -78,12 +78,17 @@ RUN { \
|
|||
\
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
\
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
chmod -R g=u /var/www
|
||||
|
||||
# Allow PHP memory_limit to be configurable. Touch the INI file and give open permissions so that
|
||||
# the entrypoint script can modify it when the container is run by non-root users.
|
||||
ENV PHP_MEMORY_LIMIT=512M
|
||||
RUN true \
|
||||
&& ini_file=/usr/local/etc/php/conf.d/memory-limit.ini \
|
||||
&& touch "$ini_file" && chmod a+rw "$ini_file"
|
||||
|
||||
VOLUME /var/www/html
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ run_as() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Update PHP's memory limit based on environment variable specified to Docker
|
||||
echo "memory_limit=$PHP_MEMORY_LIMIT" > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
|
||||
installed_version="0.0.0.0"
|
||||
if [ -f /var/www/html/version.php ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue