mirror of
https://github.com/nextcloud/docker.git
synced 2025-06-17 00:24:47 +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
|
@ -89,12 +89,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
|
||||
|
||||
RUN a2enmod rewrite remoteip ;\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue