Here is my Dockerfile. The problem is that the Image size is 9.75gb
FROM ubuntu:latest
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt && ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
# Install python and opencv
RUN apt install python3 python3-venv python3-pip python3-opencv -y
# Set the working directory
WORKDIR /App
# Copy the local directory contents to the container
COPY . .
# Install the Python dependencies
RUN pip3 install opencv-python matplotlib numpy Pillow torch torchvision tqdm pyyaml requests pandas seaborn flask flask_cors scipy --break-system-packages
# Revert back to the dialog on apt operations
ENV DEBIAN_FRONTEND=dialog
EXPOSE 5000
# Run the application
CMD ["python3", "./app.py"]
I need to install all the following python packages for a model server. I know these packages can be large but 9gbs is crazy… Can anyone help me reduce the size of the image?