From 9482589032109412172edf277d15b07c5a16f7d6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 5 Mar 2021 13:50:55 +0300 Subject: [PATCH 1/2] reduce amount of layers when building --- app/Dockerfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 5c40e40..44f98fc 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,16 +1,18 @@ FROM alpine:3.13 EXPOSE 9000/tcp -RUN apk add --no-cache dcron php8 php8-fpm \ - php8-pdo php8-gd php8-pgsql php8-pdo_pgsql php8-mbstring \ - php8-intl php8-xml php8-curl php8-session php8-tokenizer \ - php8-dom php8-fileinfo php8-json php8-iconv \ - php8-pcntl php8-posix php8-zip php8-openssl \ - git postgresql-client sudo php8-pecl-xdebug - ENV SCRIPT_ROOT=/opt/tt-rss -RUN mkdir -p /var/www ${SCRIPT_ROOT}/config.d +RUN apk add --no-cache dcron php8 php8-fpm \ + php8-pdo php8-gd php8-pgsql php8-pdo_pgsql \ + php8-mbstring php8-intl php8-xml php8-curl \ + php8-session php8-tokenizer php8-dom php8-fileinfo \ + php8-json php8-iconv php8-pcntl php8-posix php8-zip \ + php8-openssl git postgresql-client sudo php8-pecl-xdebug && \ + sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php8/php-fpm.d/www.conf && \ + sed -i.bak 's/\(memory_limit =\) 128M/\1 256M/' /etc/php8/php.ini && \ + sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf && \ + mkdir -p /var/www ${SCRIPT_ROOT}/config.d ADD startup.sh ${SCRIPT_ROOT} ADD updater.sh ${SCRIPT_ROOT} @@ -19,10 +21,6 @@ ADD dcron.sh ${SCRIPT_ROOT} ADD backup.sh /etc/periodic/weekly/backup ADD config.docker.php ${SCRIPT_ROOT} -RUN sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php8/php-fpm.d/www.conf -RUN sed -i.bak 's/\(memory_limit =\) 128M/\1 256M/' /etc/php8/php.ini -RUN sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf - ENV OWNER_UID=1000 ENV OWNER_GID=1000 From 2b7c39d76d094a234787983714c98d662d6c1c45 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 5 Mar 2021 13:56:31 +0300 Subject: [PATCH 2/2] use one build command with static --- app/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Dockerfile b/app/Dockerfile index 44f98fc..1c6e2c1 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -8,7 +8,7 @@ RUN apk add --no-cache dcron php8 php8-fpm \ php8-mbstring php8-intl php8-xml php8-curl \ php8-session php8-tokenizer php8-dom php8-fileinfo \ php8-json php8-iconv php8-pcntl php8-posix php8-zip \ - php8-openssl git postgresql-client sudo php8-pecl-xdebug && \ + php8-openssl git postgresql-client sudo php8-pecl-xdebug rsync && \ sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php8/php-fpm.d/www.conf && \ sed -i.bak 's/\(memory_limit =\) 128M/\1 256M/' /etc/php8/php.ini && \ sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf && \