harshraj22 / Dis-Sim

Microservice for calculating image similarity. Uses Message Queues.
MIT License
9 stars 3 forks source link

Reduce Docker Image Size #2

Open harshraj22 opened 2 years ago

harshraj22 commented 2 years ago

https://github.com/harshraj22/Dis-Sim/blob/2bd0336d2c25aa399f1a142b9038e73d94b961b8/src/frontend/Dockerfile#L1

The Image size is really huge. Check if there is any way around to install streamline in small sized images like alpine etc. This was required as streamlit with other images was giving errors.

harshraj22 commented 2 years ago

https://github.com/harshraj22/Dis-Sim/blob/2bd0336d2c25aa399f1a142b9038e73d94b961b8/src/similarity/Dockerfile#L4

This step makes this image huge as well. This was required to get open-cv working.

harshraj22 commented 1 year ago

check: FROM python:3.8-slim-buster docker image for Open-cv

harshraj22 commented 1 year ago

Check repos that install libraries on large images and then copy them to small images with minimal dependencies. Many times dependencies required to install libraries are not required to run them.

Technically it is called multistage build