# Express.js container image size

**URL:** <https://community.fly.io/t/express-js-container-image-size/6537>\
**Category:** Questions / Help\
**Created:** [August 25, 2022, 7:32am UTC](https://community.fly.io/t/express-js-container-image-size/6537 "2022-08-25T07:32:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eshwarenm](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/eshwarenm/32/4906_2.png) [@eshwarenm](https://community.fly.io/u/eshwarenm)\
**Post date:** [August 25, 2022, 7:32am UTC](https://community.fly.io/t/express-js-container-image-size/6537/1 "2022-08-25T07:32:26Z")

</div>

Hello. I’m new to Docker - and to Fly.

I’ve written a very small Express.js app, and deployed ( successfully ).  
I don’t have a Dockerfile.

But I noticed at build time, the image size is 774MB. Is this normal?  
 ![Screenshot 2022-08-25 at 3.26.58 PM](https://global.discourse-cdn.com/fly1/original/3X/d/5/d5805b4cc04cd9c8dd09c324a5a833a5c7c088f5.png)

Does this affect anything? Am I missing something here?

I’ve set a build-args NODE\_ENV=“production”, and I can see it doesn’t skip prunning anymore. But the image size remains pretty much the same.

Please advice.  
🙏

---

<div class="post-metadata">

**Author:** ![ignoramous](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@ignoramous](https://community.fly.io/u/ignoramous)\
**Post date:** [August 25, 2022, 9:04am UTC](https://community.fly.io/t/express-js-container-image-size/6537/2 "2022-08-25T09:04:07Z")

</div>

If you aren’t using mutli-stage builds, you should: [Docker Multi-Stage Builds | Codefresh](https://codefresh.io/blog/docker-multi-stage-builds/)

Here’s a mutli-stage `dockerfile` from our nodejs project that deploys to Fly: [serverless-dns/node.Dockerfile at 04a1184189905fcbe3e28dedff61f3c70190c2b0 · serverless-dns/serverless-dns · GitHub](https://github.com/serverless-dns/serverless-dns/blob/04a11841/node.Dockerfile) (size is ~150M, I think…)

I’ve been meaning to experiment with _railway nixpacks_, but unsure whether using it as-is optimizes for the image size, as well: [Build images with nixpacks](https://community.fly.io/t/build-images-with-nixpacks/6169)

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [August 26, 2022, 2:18pm UTC](https://community.fly.io/t/express-js-container-image-size/6537/3 "2022-08-26T14:18:14Z")

</div>

Nixpacks still create large images.

Large images are irritating, but not usually a problem. I would be concerned about a 1.5GB+ image. 800MB is not so bad.

I make all my images small, though. It’s a fun exercise. 🙂
