Memmory optimisation for docker image
Change-Id: I33a74b159b18297c88ff3821b852009c8fc7ad1a
Signed-off-by: Monosij Ghosh <mono.ghosh@samsung.com>
--- /dev/null
+.git
+*.log
+__pycache__/
+*.pyc
+*.pyo
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