danvergara / morphos

Self-hosted file converter server
MIT License
750 stars 33 forks source link

Add multi stage to the dockerfile with ubuntu as last stage to get the same env without non necessary deps #23

Closed danvergara closed 6 months ago

danvergara commented 6 months ago

Optimize Container image size

Description

Add multi-stage to the Dockerfile with Ubuntu as last stage without non-necessary dependencies (go, git, etc.) just having the dependencies required by libheif and go-avif and the final binary. Before the change the image size was 1.16 GB and now it is 520 MB.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

I built the image locally many times and used dive to dive deeper into the image file system to see potential improvements.

Checklist: