From 07a969cc51c594fb400a656073d4d803246dc90c Mon Sep 17 00:00:00 2001 From: Thomas Durieux <5577568+tdurieux@users.noreply.github.com> Date: Tue, 10 Jan 2023 11:37:38 +0100 Subject: [PATCH] docker: Reduce Dockerfile image size (#514) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 787fc407f..a8dedcea3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM pelias/baseimage # downloader apt dependencies # note: this is done in one command in order to keep down the size of intermediate containers -RUN apt-get update && apt-get install -y unzip awscli && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install --no-install-recommends -y unzip awscli && rm -rf /var/lib/apt/lists/* # change working dir ENV WORKDIR /code/pelias/openaddresses @@ -11,7 +11,7 @@ WORKDIR ${WORKDIR} # copy package.json first to prevent npm install being rerun when only code changes COPY ./package.json ${WORKDIR} -RUN npm install +RUN npm install && npm cache clean --force; # copy code into image ADD . ${WORKDIR}