From 7766403b823ac7f108032569e28b10d1d46a47ca Mon Sep 17 00:00:00 2001 From: Chris Halls Date: Thu, 9 Jan 2020 17:58:03 +0100 Subject: [PATCH] Refactor multiple sed invocations into one command line This reduces the number of lines where we have to specify the name of the php.ini file to modify --- web/Dockerfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index eac2366..849bd4e 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -30,13 +30,11 @@ RUN apt-get install -y libapache2-mod-php7.2 php7.2 php7.2-cli php7.2-dev \ apt-get install -y php7.2-mbstring # Fix php.ini with recommended settings -RUN sed -i "s/max_execution_time = 30/max_execution_time = 300/" \ - /etc/php/7.2/apache2/php.ini && \ - sed -i "s/memory_limit = 128M/memory_limit = 2048M/" \ - /etc/php/7.2/apache2/php.ini && \ - sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 50M/" \ - /etc/php/7.2/apache2/php.ini && \ - sed -i "s/post_max_size = 8M/post_max_size = 50M/" \ +RUN sed -i \ + -e "s/max_execution_time = 30/max_execution_time = 300/" \ + -e "s/memory_limit = 128M/memory_limit = 2048M/" \ + -e "s/upload_max_filesize = 2M/upload_max_filesize = 50M/" \ + -e "s/post_max_size = 8M/post_max_size = 50M/" \ /etc/php/7.2/apache2/php.ini RUN apt-get install -y python-dev python-pip libxml2-dev libxslt1-dev \