R
Railwayβ€’7mo ago
ethan

Deploy specific pNPM Turborepo workspace that is run on Bunjs

Hello all! I am attempting to deploy a single pNPM-based Turborepo project (is that what they are called?, apps/api that is currently using a start command that relies on Bunjs being available in the current context (pnpm with-env bun run src/index.ts). That command works locally but I can't seem to get it to work on Railway. What would be the easiest way to get Bun on the container so it can run like this, or is this a bad method and there is a simpler way that I am missing.
Solution:
add it as a nix package, add this to a nixpacks.toml file ```toml [phases.setup] nixpkgsArchive = '231b230513b81db80821be631f2e395e26a21f16' nixPkgs = ['...', 'bun']...
Jump to solution
19 Replies
Percy
Percyβ€’7mo ago
Project ID: N/A
ethan
ethanβ€’7mo ago
N/A
Solution
Brody
Brodyβ€’7mo ago
add it as a nix package, add this to a nixpacks.toml file
[phases.setup]
nixpkgsArchive = '231b230513b81db80821be631f2e395e26a21f16'
nixPkgs = ['...', 'bun']
[phases.setup]
nixpkgsArchive = '231b230513b81db80821be631f2e395e26a21f16'
nixPkgs = ['...', 'bun']
ref: https://github.com/NixOS/nixpkgs/commit/231b230513b81db80821be631f2e395e26a21f16
ethan
ethanβ€’7mo ago
ok dope thanks fellow canadian who laughed at nintendo's silly signup form should i leave the ...
ethan
ethanβ€’7mo ago
alright thanks appreciate you
Brody
Brodyβ€’7mo ago
did it work?
ethan
ethanβ€’7mo ago
...havent tested it yet πŸ˜…
Brody
Brodyβ€’7mo ago
haha well that is 100% how you add bun, but there always could be additional config needed
ethan
ethanβ€’7mo ago
nws i will report here my results just in case it ends up not working
Brody
Brodyβ€’7mo ago
sounds good
ethan
ethanβ€’7mo ago
alright it built successfully but im getting 'application failed to respond' - im assuming this is because i set my port wrong so i updated it and we shall see...
ethan
ethanβ€’7mo ago
yea was just reading that haha does it have to be 0.0.0.0 or can it be ::? (using fastify)
Brody
Brodyβ€’7mo ago
:: works yep
ethan
ethanβ€’7mo ago
alright sounds good still getting application failed to respond - i set a PORT env var to 3001 (where the application is listening) and the host to 0.0.0.0 in fastify yet still no luck oop nvm shes working just took a second
Brody
Brodyβ€’7mo ago
all set?
ethan
ethanβ€’7mo ago
yep all set thanks a bunch
Brody
Brodyβ€’7mo ago
no problem πŸ™‚