a year ago
Project ID: 1ad2e8d9-d8df-4cd2-aca2-4be43f7219d3
Environment ID: d579dbb9-e696-4beb-bbb5-84e1c176d53f
I'm currently experimenting on our backend deployments to try to improve build and deployment time and I'm noticing a huge difference between Nixpacks and Docker deployments.
Nixpacks-based deployment:
Time to build: 3:32min
Time to deploy: 1:34min
Time between build log last line and pre-deploy first line: 1:03min
Docker-based deployment:
Time to build: 1:00min (no cached layers)
Time to deploy: 0:35min
Time between build log last line and pre-deploy first line: 0:15min
This is a Turborepo monorepo with a Express-based backend and a few internal packages loaded.
The build time in Nixpacks is mostly spent outside of the actual Turborepo build and the yarn package install (which is actually pretty fast for that repo size).
My main thought would be around build image size, my Dockerfile being a multi-stage build with an output size of 405MB, including only the backend dependencies and extra packages for the database migration tools.
I don't know any way to see what's the situation over Nixpacks but I suppose it keeps all the monorepo packages in the final image, which Yarn indicates to be around 1.26GiB (thanks Expo/React Native).
From that, I have those questions:
Is this a normal/expected behavior?
Is my hypothesis correct/plausible?
What's recommended between Nixpacks and Docker images in terms of integration with Railway (monitoring, serverless/sleep mode, …)?
Thanks!
15 Replies
a year ago
unfortunately yes, nixpacks doesn't do any steps, pruning, etc
yes 100%
absolutely no difference, you dont lose any platform features with a dockerfile, so no recommendations, just whatever works best for your needs
I just need to fix my predeploy script so it can wake up my Posgres instance on dev environments ^^
a year ago
you could also just add connection retires into your code?
Also, it seems like Nixpacks wasn't able to do any caching where the Dockerimage is able to, so I'm good for it!
a year ago
fair enough
a year ago
good thing we are well underway on alterative solutions 😉
But I can use pg_isready instead. Ping was working on Nixpacks but not on Docker (for some reason it doesn't have the perms, probably Alpinelinux)
So in any case, I'll actually have a more reliable way to know if my DB is ready than just pinging it 😄
a year ago
makes sense
a year ago
indeed
a year ago
you as well!
a year ago
!s
Status changed to Solved brody • about 1 year ago