From 0210e832e9845d477dd589f7fa8ca898c0447f66 Mon Sep 17 00:00:00 2001 From: SENTHIL ATHIBAN M <93466587+senthil-athiban@users.noreply.github.com> Date: Tue, 30 Jul 2024 23:23:31 +0530 Subject: [PATCH] (fix): add layer caching in dockerFile (#210) --- docker/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 201eea9e..bccb670b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,9 +5,13 @@ FROM python:3.11-slim WORKDIR /app -# Copy code and install Python dependencies. +# Copy the requirements file first to leverage Docker's cache. +COPY /store/requirements.txt /app + +# Install Python dependencies. +RUN pip install --no-cache-dir -r requirements.txt + COPY . /app -RUN pip install --no-cache-dir --upgrade . # Expose the port that the application runs on. EXPOSE 8080