May 23, 2026

Container shrinkage, comment explosion

We reduced a real Node.js production Docker image from 1.2GB to 78MB

One giant app went on a brutal diet, and the comments instantly started fighting

TLDR: A developer cut a real app package from 1.2GB to 78MB by stripping out extra baggage and reorganizing how it’s built. Commenters turned that win into a brawl over whether the tiny setup causes weird slowdowns, whether the article was copied, and whether the whole thing was “AI slop.”

A developer proudly showed how they shrank a real app package from a hulking 1.2GB to 78MB, basically turning a moving truck into a carry-on suitcase. On paper, this is a feel-good makeover story: faster shipping, lower costs, fewer hidden files, and less junk riding along for the trip. But in the comments, the real sport wasn’t celebrating the glow-up — it was arguing about how real it was, whether it was safe, and whether the whole thing was even original.

The biggest split came over the app’s smaller “Alpine” base, which is like choosing the ultra-light version of the operating system. One commenter said their app on Alpine turned simple internet lookups into a several-hundred-millisecond crawl, and switching back to Debian made it drop to microseconds. Translation for non-nerds: one person basically walked in saying, “Cute trick, but this broke my app.” Others were more supportive, with one calling the “slim” version the easiest and biggest-impact change.

Then came the scandal energy. One commenter flat-out asked if the post was ripped content, dropping a Medium link. Another went for the full internet flamethrower: “AI slop articles” aimed at software engineers. And of course, there was the drive-by comedian who ignored all of it and declared: forget containers, just rewrite it in Go and make it 4MB. Classic comments section: half useful advice, half food fight, fully entertaining.

Key Points

  • The article starts from a naive production Dockerfile for a Node.js and TypeScript service that builds to a 1.21GB image.
  • Switching the base image from `node:22` to `node:22-slim` reduces the image size from 1.21GB to 412MB.
  • Adding a `.dockerignore` file cuts the image from 412MB to 388MB and avoids copying items such as `node_modules`, `.git`, `.env*`, and build artifacts.
  • A multi-stage build combined with `npm ci` and `npm prune --omit=dev` reduces the image from 388MB to 198MB by keeping only runtime artifacts and production dependencies.
  • Reordering Dockerfile steps to improve layer caching cuts rebuild time from 94 seconds to 18 seconds for code-only changes, and switching only the runtime stage to Alpine reduces the image from 198MB to 96MB.

Hottest takes

"dns lookup ... taking several hundred milliseconds every time" — tpaksoy
"Surely this is ripped content?" — 1a527dd5
"This website seems entirely filled with AI slop articles" — wxw
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.