mirror of
https://github.com/friendica/docker
synced 2025-01-06 06:07:47 +01:00
Merge pull request #178 from nupplaphil/feat/memory_limit
Add PHP limit environment variables
This commit is contained in:
commit
e6d983d6c2
12 changed files with 84 additions and 11 deletions
|
@ -119,6 +119,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -135,7 +137,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -100,6 +100,8 @@ RUN set -ex; \
|
|||
apk del --no-network .build-deps;
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -116,7 +118,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -119,6 +119,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -135,7 +137,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -119,6 +119,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -135,7 +137,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -100,6 +100,8 @@ RUN set -ex; \
|
|||
apk del --no-network .build-deps;
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -116,7 +118,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -119,6 +119,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -135,7 +137,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -119,6 +119,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -135,7 +137,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -100,6 +100,8 @@ RUN set -ex; \
|
|||
apk del --no-network .build-deps;
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -116,7 +118,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -119,6 +119,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -135,7 +137,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -99,6 +99,8 @@ RUN set -ex; \
|
|||
apk del --no-network .build-deps;
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -115,7 +117,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -118,6 +118,8 @@ RUN set -ex; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
ENV PHP_MEMORY_LIMIT 512M
|
||||
ENV PHP_UPLOAD_LIMIT 512M
|
||||
RUN set -ex; \
|
||||
{ \
|
||||
echo 'opcache.enable=1' ; \
|
||||
|
@ -134,7 +136,11 @@ RUN set -ex; \
|
|||
\
|
||||
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; \
|
||||
{ \
|
||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||
\
|
||||
mkdir /var/www/data; \
|
||||
chown -R www-data:root /var/www; \
|
||||
|
|
|
@ -92,6 +92,13 @@ There are two options to enable background tasks for Friendica:
|
|||
- `REDIS_PW` (optional) The password for the redis instance (in case of locking).
|
||||
- `REDIS_DB` (optional) The database instance of the redis instance (in case of locking).
|
||||
|
||||
**PHP limits**
|
||||
|
||||
- `PHP_MEMORY_LIMIT` (default `512M`) This sets the maximum amount of memory in bytes that a script is allowed to allocate.
|
||||
This is meant to help prevent poorly written scripts from eating up all available memory, but it can prevent normal operation if set too tight.
|
||||
- `PHP_UPLOAD_LIMIT` (default `512M`) This sets the upload limit (`post_max_size` and `upload_max_filesize`) for big files.
|
||||
Note that you may have to change other limits depending on your client, webserver or operating system.
|
||||
|
||||
## Administrator account
|
||||
|
||||
Because Friendica links the administrator account to a specific mail address, you **have** to set a valid address for `MAILNAME`.
|
||||
|
|
Loading…
Reference in a new issue