Node.js deployment docs

Hey! Are there canonical docs on running Node.js/epxress apps on Railway? I'd like to understand better how it picks the node version it runs (.nvmrc?), which command it runs (npm start?), how to add a build/compile step. Google doesn't turn up anything useful.
15 Replies
Percy
Percy4w ago
Project ID: dff4b85e-146a-4699-a2e4-584564299cc9
pesterhazy
pesterhazyOP4w ago
dff4b85e-146a-4699-a2e4-584564299cc9
pesterhazy
pesterhazyOP4w ago
Given that I'm using a nixpack, I think part of the answer is here https://nixpacks.com/docs/providers/node
Node | Nixpacks
App source + Nix packages + Docker = Image
Brody
Brody4w ago
pesterhazy
pesterhazyOP4w ago
Looks like it's picking process.version.node=22.3.0 even though I specified
% cat .nvmrc
v22.9.0
% cat .nvmrc
v22.9.0
Brody
Brody4w ago
.nvmrc isnt used
pesterhazy
pesterhazyOP4w ago
Would it be fair to say that I'm better off using a Dockerfile if I want full control over the node version?
Brody
Brody4w ago
control over the minor and patch versions, yes
pesterhazy
pesterhazyOP4w ago
👍 Is there diff in deployment speed between nixpacks and using my own Dockerfile? Deploymnet feel quite fast as they are right now, and I'd like to not slow that down too much
Brody
Brody4w ago
there can be, with a dockerfile, there is no time spent installing nix stuff, so that shaves off time
pesterhazy
pesterhazyOP4w ago
oh, so you're saying docker could actually be faster?
Brody
Brody4w ago
it could
pesterhazy
pesterhazyOP4w ago
awesome, I'll try that then last question, do you have a pointer for an example railway typescript project that uses a dockerfile rather than nixpack?
Brody
Brody4w ago
heres a dead simple dockerfile, its pretty generic - https://docs.railway.app/guides/remix#use-a-dockerfile but please know that dockerfiles aren't specific to railway
pesterhazy
pesterhazyOP4w ago
sure I understand thant *that thanks, that's very helpful
Want results from more Discord servers?
Add your server