Skip to content

Commit

Permalink
Set PHP memory_limit to 128M, allow to override. (#16)
Browse files Browse the repository at this point in the history
Make php.ini use the PHP_MEMORY_LIMIT env variable (with default value of 128M).
  • Loading branch information
naveenvalecha authored Jan 31, 2024
1 parent 9f503aa commit 0046040
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php"

ENV COMPOSER_VERSION=2.6.6 \
COMPOSER_HASH_SHA256=72600201c73c7c4b218f1c0511b36d8537963e36aafa244757f52309f885b314
COMPOSER_HASH_SHA256=72600201c73c7c4b218f1c0511b36d8537963e36aafa244757f52309f885b314 \
PHP_MEMORY_LIMIT=128M

RUN apk add --no-cache --update git \
bash \
Expand All @@ -20,7 +21,8 @@ RUN apk add --no-cache --update git \
&& rm -rf /var/cache/apk/* \
&& curl -L -o /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& echo "$COMPOSER_HASH_SHA256 /usr/local/bin/composer" | sha256sum -c \
&& chmod +x /usr/local/bin/composer
&& chmod +x /usr/local/bin/composer \
&& echo 'memory_limit = ${PHP_MEMORY_LIMIT}' > /usr/local/etc/php/conf.d/memory-limit.ini

RUN adduser -D -h /home/runner -u $RUNNER_UID runner

Expand Down

0 comments on commit 0046040

Please sign in to comment.