worklenz icon indicating copy to clipboard operation
worklenz copied to clipboard

[PR] Resized the sizes of final images for frontend and backend below 150MB

Open pasanchamikara opened this issue 1 year ago • 4 comments

This PR would bring the final image sizes of the docker build below 150MB, making it easier (Saves bandwidth) for any K8s pod or a docker run Instance to re-instantiate the application.

build-images

The approach of multi-layered docker images are followed.

Main Changes

  1. Instead of single worker of Angular app treating the client requests directly, we have utilized a nginx frontend which treats requests via port 80 and 443 (Not 4200).
  2. Backend utilizes alpine images in runner stage. Though we wanted to use the same for builder, there are some alpine linux issues which forced us to make use of the same base image which used to work. Somehow, still the backend image could be resolved to 143MBs.
  3. Frontend image size is 21.8 MB

pasanchamikara avatar Jun 30 '24 05:06 pasanchamikara

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 30 '24 05:06 CLAassistant

@pasanchamikara please sign the CLA , then we will evaluate

kalinga777 avatar Jul 03 '24 00:07 kalinga777

@kalinga777 done!

pasanchamikara avatar Jul 03 '24 01:07 pasanchamikara

Great common optimizations for a docker build.

Maybe switch to caddy for the serving to get easy automatic HTTPS?

gdevenyi avatar Jul 04 '24 16:07 gdevenyi