Skip to content

fix: Remove 60 MB (28%) of dev dependencies from final docker images#28160

Merged
Koenkk merged 1 commit intoKoenkk:devfrom
krkk:docker-no-devdeps
Aug 4, 2025
Merged

fix: Remove 60 MB (28%) of dev dependencies from final docker images#28160
Koenkk merged 1 commit intoKoenkk:devfrom
krkk:docker-no-devdeps

Conversation

@krkk
Copy link
Copy Markdown
Contributor

@krkk krkk commented Aug 2, 2025

All development dependencies were previously bundled in the final image.
Most notably, this included typescript compiler (22 MiB), esbuild (12.7 MiB), and some type declaration packages.
Not copying development dependencies saves about 60 MB of storage space.

For x86_64 this makes the image size go down from 217 MiB to 156 MiB, and similarly for arm64 – from 213 MiB to 153 MiB.


Honestly, I'm not familiar with docker and nodejs ecosystem much and I only started using z2m just this week.
Buuuut it seems working 😅, though idk if some package like typescript was also used for extensions..

All development dependencies were previously bundled in the final image.
Most notably, this included typescript compiler (22 MiB), esbuild (12.7 MiB),
and some type declaration packages.
Not copying development dependencies saves about 60 MB of storage space.

For x86_64 this makes the image size go down from 217 MiB to 156 MiB, and
similarly for arm64 -- from 213 MiB to 153 MiB.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 2, 2025

CodSpeed Performance Report

Merging #28160 will not alter performance

Comparing krkk:docker-no-devdeps (299c28b) with dev (449b99b)

Summary

✅ 9 untouched benchmarks

@Nerivec
Copy link
Copy Markdown
Collaborator

Nerivec commented Aug 2, 2025

pnpm is ignoring this?

ENV NODE_ENV=production

@krkk
Copy link
Copy Markdown
Contributor Author

krkk commented Aug 2, 2025

seems like it started ignoring that in v10.x, yeah. huh

compare https://pnpm.io/9.x/cli/install#--prod--p and https://pnpm.io/10.x/cli/install#--prod--p

there's also a linked issue in the v10.0.0 changelog: pnpm/pnpm#8827

@Koenkk Koenkk merged commit 050ebfc into Koenkk:dev Aug 4, 2025
12 checks passed
@Koenkk
Copy link
Copy Markdown
Owner

Koenkk commented Aug 4, 2025

Thanks!

I checked the HA addon and there it was already applied

@krkk krkk deleted the docker-no-devdeps branch August 4, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants