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

use multistage build to slim down backend container #22

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

Conversation

lpmi-13
Copy link
Contributor

@lpmi-13 lpmi-13 commented Jan 30, 2023

[Description]

Use a multistage build to trim down about a GB from the final container

docker images | grep slo-tracker
slo-tracker-multistage                          latest            2e817d565dc5   14 minutes ago   8.44MB
slo-tracker-original                            latest            fb1f91e53890   2 hours ago      1.04GB

What kind of changes do it do

Use a multistage build copying the final binary (that now has debugging and symbol tables stripped to make it even smaller) into a scratch container, which has basically nothing else in it. If you want to make it even smaller, you could remove the copying of the ssl certificates, but they don't really add that much size, and might be nice to have them if you ever need to run this with TLS in production.

Please delete options that are not relevant.

  • FEATURE ( change which adds functionality )

Need any DB Migrations?

  • Yes
  • No

How have you tested this

docker-compose up --build and navigate to localhost:3000, then add some test SLOs

This change requires a documentation update?

  • Yes
  • No

Code Checklist

  • Build passed
  • My changes generate no new warnings
  • Manually Tested
  • Rebased with master/upto date with master

Pre-Merge Checklist

  • I have Labeled my PR
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas

@lpmi-13
Copy link
Contributor Author

lpmi-13 commented Jan 31, 2023

actually...this seems to have broken the /overview page, but I'm not exactly sure how. Lemme see if I can fix it.

@lpmi-13
Copy link
Contributor Author

lpmi-13 commented Jan 31, 2023

hmmmm...actually seems to be unrelated to the change in this PR, but do please test it out locally and see if you see any issues, especially on the /overview page.

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.

None yet

1 participant