From: Monosij Ghosh Date: Wed, 27 Nov 2024 09:08:02 +0000 (+0530) Subject: Data extraction module docker file optimisation X-Git-Tag: k-release~2^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=df04248a62af051f0fbcc682937861a0f5cf310c;p=aiml-fw%2Fathp%2Fdata-extraction.git Data extraction module docker file optimisation Memmory optimisation for docker image Change-Id: I2b0e5748973409b5357ac4147e418bba6267db01 Signed-off-by: Monosij Ghosh --- diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..10dd1e3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +*.log +__pycache__/ +*.pyc +*.pyo \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 64f1aa8..90fe426 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,32 +18,30 @@ FROM ubuntu:22.04 # location in the container -ENV TA_DIR /home/app/ +ENV TA_DIR=/home/app -# Install dependencies -RUN apt-get update && apt-get install -y \ - python3 && apt-get install -y \ - python3-pip +# Setup JAVA_HOME -- useful for docker commandline +ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ -# Install OpenJDK-11 for Spark -RUN apt-get update && \ - apt-get install openjdk-11-jre openjdk-11-jdk -y && \ - apt-get clean; +WORKDIR ${TA_DIR} +# Install dependencies RUN apt-get update && \ - apt-get install scala -y && \ - apt-get clean; - -# Setup JAVA_HOME -- useful for docker commandline -ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/ -RUN export JAVA_HOME + apt-get install -y --no-install-recommends \ + python3 \ + python3-pip \ + python3-dev \ + build-essential \ + openjdk-11-jre \ + openjdk-11-jdk \ + scala && \ + apt-get clean && rm -rf /var/lib/apt/lists/* -WORKDIR ${TA_DIR} # Copy sources into the container COPY . . #Install the pip3 requirements -RUN pip3 install -r requirements.txt +RUN pip3 install --no-cache-dir -r requirements.txt #Expose the ports EXPOSE 32000