Skip to content

Commit

Permalink
Add PHP_MEMORY_LIMIT support in Dockerfile
Browse files Browse the repository at this point in the history
Why:

Being able to increase memory size is a useful feature in some cases.

What:

Add an ENV directive to the Dockerfile, allowing to pass a value to
configuration the PHP memory_limit php.ini directive. Use that
environment variable in php.ini, since it supports that.
  • Loading branch information
akosiaris committed Mar 4, 2024
1 parent f59fb4b commit 9be0969
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ RUN set -ex \
&& envsubst < /etc/wallabag/parameters.template.yml > app/config/parameters.yml \
&& SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist --no-progress \
&& rm -rf /root/.composer/* /var/www/wallabag/var/cache/* /var/www/wallabag/var/logs/* /var/www/wallabag/var/sessions/* \
&& chown -R nobody:nobody /var/www/wallabag
&& chown -R nobody:nobody /var/www/wallabag \
&& sed -i -e 's/memory_limit = 128M/memory_limit = ${PHP_MEMORY_LIMIT}/' /etc/php81/php.ini

ENV PATH="${PATH}:/var/www/wallabag/bin"
ENV PHP_MEMORY_LIMIT=128M

# Set console entry path
WORKDIR /var/www/wallabag
Expand Down

0 comments on commit 9be0969

Please sign in to comment.