From 11b3c05bc9d756d498b2bcce1c31649bdc0dd2fb Mon Sep 17 00:00:00 2001 From: Monosij Ghosh Date: Tue, 26 Nov 2024 14:50:39 +0530 Subject: [PATCH] Kubeflow Adapter module docker file optimisation Memmory optimisation for docker image Change-Id: I33a74b159b18297c88ff3821b852009c8fc7ad1a Signed-off-by: Monosij Ghosh --- .dockerignore | 5 +++++ Dockerfile | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8839a47 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +*.log +__pycache__/ +*.pyc +*.pyo diff --git a/Dockerfile b/Dockerfile index a17ffb1..ed78ce2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,21 +19,19 @@ FROM ubuntu:22.04 # location in the container -ENV TA_DIR /home/app/ +ENV TA_DIR=/home/app/ +WORKDIR ${TA_DIR} # Install dependencies -RUN apt-get update && apt-get install -y \ - python3 && apt-get install -y \ - python3-pip -WORKDIR ${TA_DIR} +RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* # Copy sources into the container COPY . . #Install the pip3 requirements -RUN pip3 install . -RUN pip3 install -r requirements.txt -RUN pip3 install requests-toolbelt==0.10.1 +RUN pip3 install --no-cache-dir -r requirements.txt requests-toolbelt==0.10.1 . #Expose the ports EXPOSE 5000 -- 2.16.6