This PR reduces the Docker image size massively while remaining on Debian Bookworm, as far as I can tell there should be no ill effects. Below are my comparisons.
Each step was rebuilt to ease comparison with:
docker build -t librelink-up-pr .
And they include the changes from previous steps.
Sizes are compared with:
docker image ls | grep librelink | awk '{print $NF,$1}'
Also a .dockerignore file is included to avoid copying the git-related files and directories into the image.
This PR reduces the Docker image size massively while remaining on Debian Bookworm, as far as I can tell there should be no ill effects. Below are my comparisons.
Each step was rebuilt to ease comparison with:
And they include the changes from previous steps.
Sizes are compared with:
Also a
.dockerignore
file is included to avoid copying the git-related files and directories into the image.Starting point
Switch to node:20-bookworm-slim as base image
Use a separate builder stage
Remove devDependencies
This also involves pre-compiling the TypeScript code, I've changed the
CMD
to reusestart-heroku
Compressed size difference
For additional context: