0
0
Fork 0
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:
Robert Dailey 2018-12-06 14:45:13 -06:00
parent 783232840a
commit f988290dc9
No known key found for this signature in database
GPG key ID: 97751323F0627314
22 changed files with 109 additions and 22 deletions

View file

@ -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