Optimizing CI with pnpm Migration and Multi-Stage Docker BuildsOptimizing CI with pnpm Migration and Multi-Stage Docker Builds
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
A cleanup on my Mac turned into a CI optimization across several projects.
It started with 30 GB of npm cache and another 20 GB in old node_modules folders. After recovering roughly 50 GB, I moved several projects to pnpm.
Updating CI for the migration led me to review the pipelines themselves. I found duplicate stages and Docker images carrying build-time dependencies and unnecessary files into production.
I removed the duplicate work and switched to multi-stage Docker builds, keeping only what each app needed at runtime.
On some projects, average CI runs dropped from 6–7 minutes to about 2. A few longer pipelines went from 15–16 minutes to around 6.
The pnpm migration also sped up dependency installs and gave me more control over dependency install scripts.
What’s had the biggest impact on build times in your projects?
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started