Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pasanchamikara
Copy link

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

@CLAassistant
Copy link

CLAassistant commented Jun 30, 2024

CLA assistant check
All committers have signed the CLA.

@kalinga777
Copy link
Contributor

@pasanchamikara please sign the CLA , then we will evaluate

@pasanchamikara
Copy link
Author

@kalinga777 done!

@gdevenyi
Copy link
Contributor

gdevenyi commented Jul 4, 2024

Great common optimizations for a docker build.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants