Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Reduce Docker image size #39

Open
CDDelta opened this issue Mar 12, 2021 · 1 comment
Open

Reduce Docker image size #39

CDDelta opened this issue Mar 12, 2021 · 1 comment
Labels
enhancement New feature or request next release Tasked for next released

Comments

@CDDelta
Copy link

CDDelta commented Mar 12, 2021

Currently, the size of the built Docker image is >1GB. It should be possible to reduce this quite significantly with some changes which will make spinning up new gateway instances faster and cheaper.

The size can be reduced in two ways by:

  • Making use of multi-stage builds in Docker and only packaging production node_modules in the final image.
  • Using a smaller Node image like the Node alpine images.

Dropping the dependency on ts-node brought in by knex would be great as well though I'm not sure how one could do that if migrations need to be ran in the production container.

Multi-stage builds: https://blog.logrocket.com/reduce-docker-image-sizes-using-multi-stage-builds/

Alpine and other Docker images: https://medium.com/swlh/alpine-slim-stretch-buster-jessie-bullseye-bookworm-what-are-the-differences-in-docker-62171ed4531d

@TheLoneRonin TheLoneRonin added the enhancement New feature or request label Mar 17, 2021
@TheLoneRonin
Copy link
Contributor

Love the feedback @CDDelta these are high value adds we definitely want! :D

@TheLoneRonin TheLoneRonin added backlog Backlogged deliverables next release Tasked for next released and removed backlog Backlogged deliverables labels Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request next release Tasked for next released
Projects
None yet
Development

No branches or pull requests

2 participants