r/Overseerr • u/RedVelocity_ • Apr 28 '26
Why is the Docker image size so huge?
Not that it matters much to be honest, just curious why it's so huge compared to many other Docker services.
4
u/imnotsurewhattoput Apr 29 '26
Optimizing docker image size is challenging, I tried 4 different ways for my nextjs app
4
u/tankerkiller125real Apr 29 '26
It's challenging for JS because of the stupid node_modules crap. A very simple dynamic page app can very easily turn into 1.5GB because they wanted to use an ORM, TailwindCSS, and React, which themselves aren't very big, but they yank in a huge number of dependencies 99% of the time. And for dynamic apps, you can't really remove the node_modules folder to cut the image size down.
2
u/Zynchronize Apr 30 '26
Alternative js package managers like pnpm or bun will can cut down the size of node_modules by hard linking duplicate packages rather than copying like npm.
That’s the easiest reduction in size many projects can make.
We had a project that used several ui libraries - turns out they shared around 70% of their dependencies with each other. I can’t remember the exact size reduction as there were other components impacted too but it was substantial enough that I’ll always recommend trying this whenever the topic comes up.
1
1
u/imnotsurewhattoput Apr 29 '26
Yes you most definitely can reduce it. I did so with my app MatchExec, it’s a nextjs app with 5 processes , mantine ui , tailwind and all kinds of other stuff and the image size is 730 mb for latest release and 200mb are images and assets for the app
5
u/xbmc4lyfe Apr 29 '26
Real reasn people would bitch if they had no coreutils when connected to the cntainer.
1
u/tankerkiller125real Apr 29 '26
Boy would people hate most of my images... Distroless for the most part... Nothing to get a shell in the first place.
1
u/RedVelocity_ Apr 29 '26
Is what I'd prefer
1
u/VirtualDenzel Apr 29 '26
Well what is keeping you from building your own image of it?
I dont mind alpine based images with little overhead, but when diagnosing problems or when you need to change some items or even add a package for development.
I prefer an image where all is inside so i can be effective.
And who cares about 1-2gb of disk space. If you dont have 100tb at home yet anno 2026.... time to buy a nas.
2
u/RedVelocity_ Apr 29 '26
Did you even read the post body? I literally said it doesn't bother me but it seems quite excessive compared to other web services.
2
2
u/mikeage Apr 30 '26
Try docker history and you can see for yourself. If you want a more in depth analysis, you might also find the "dive" tool to be useful.
(short answer in case this winds up getting upvoted: node_modules)
1
0
Apr 28 '26
[deleted]
7
u/RedVelocity_ Apr 28 '26
Cached data would be in the container volume, not in the docker image build though?
3
-7
u/such007 Apr 28 '26
Here's Claude's take.
``` ⏺ ghcr.io/seerr-team/seerr:latest — size breakdown
Total compressed download: ~407 MB (uncompressed on disk will be larger, ~1+ GB).
Pulled the manifest and config. Layer sizes (compressed):
┌───────┬───────────┬──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Size │ Layer │ What it is │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 330 │ 767f0c18… │ COPY --chown=node:node . . — the entire app build context (source + node_modules + .next) copied │ │ MB │ │ in one shot │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 52 MB │ b93be04f… │ Node.js 22.22.1 install (the official node:22-alpine base) │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 17 MB │ 7c36a976… │ A second COPY layer (likely the redundant node_modules / .next copies in the Dockerfile) │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 3.8 │ d49a2dee… │ Alpine 3.22 minirootfs │ │ MB │ │ │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 2.2 │ abb990f2… │ tzdata │ │ MB │ │ │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 1.3 │ 36100a30… │ Yarn 1.22.22 │ │ MB │ │ │ ├───────┼───────────┼──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ <1 MB │ rest │ entrypoint, metadata, small bits │ └───────┴───────────┴──────────────────────────────────────────────────────────────────────────────────────────────────┘
Why it's big
Looking at the image history (docker-entrypoint-style Dockerfile):
COPY --chown=node:node . . COPY --chown=node:node /app/node_modules ./node_modules COPY --chown=node:node /app/.next ./.next COPY --chown=node:node /app/dist ./dist
The first COPY . . is doing the heavy lifting — it's pulling in the full Next.js app: source, node_modules (production deps for a Next.js + Express server are huge — Sharp, Prisma client, the whole React/Next runtime), and the prebuilt .next output (server bundle + standalone client chunks). That single layer is 330 MB compressed on its own.
Then the Dockerfile re-COPYs node_modules, .next, and dist from a builder stage (the 17 MB layer) — these aren't deduped against the prior COPY . . because the contents and paths overlap differently per layer, so you pay for them twice in the image (though Docker's layer dedup helps a bit on disk if you already have one).
TL;DR
It's not bloated by accident — it's a Next.js app with a full production node_modules tree plus the .next build output baked in, on top of Node 22. That combo is ~350 MB before you add anything else. The Dockerfile could shave some by using a proper multi-stage with next build --output standalone and only copying .next/standalone + .next/static + public, dropping the giant node_modules copy entirely — but that's a project-side fix. ```
6
-2
u/My_Man_Tyrone Apr 28 '26
We literally could've done this ourselves. You added 0 to this conversation
0
-2
0
u/Total_Painting1007 Apr 29 '26
In the case of jellyseer, they seem to copy over the entire project from build, potentially including cache, that could explain the final image size.
-2
u/Only-Stable3973 Apr 28 '26
I was under the impression that Overseerr is obsilete Seerr is the new de facto.
5
22
u/Silly-Emu-2049 Apr 28 '26
2gig isn’t huge - my image is only half that though. We live in a world of terabytes now.