R
Railwayβ€’13mo 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β€’13mo ago
Project ID: N/A
ethan
ethanOPβ€’13mo ago
N/A
Solution
Brody
Brodyβ€’13mo 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
ethanOPβ€’13mo ago
ok dope thanks fellow canadian who laughed at nintendo's silly signup form should i leave the ...
ethan
ethanOPβ€’13mo ago
alright thanks appreciate you
Brody
Brodyβ€’13mo ago
did it work?
ethan
ethanOPβ€’13mo ago
...havent tested it yet πŸ˜…
Brody
Brodyβ€’13mo ago
haha well that is 100% how you add bun, but there always could be additional config needed
ethan
ethanOPβ€’13mo ago
nws i will report here my results just in case it ends up not working
Brody
Brodyβ€’13mo ago
sounds good
ethan
ethanOPβ€’13mo 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
ethanOPβ€’13mo ago
yea was just reading that haha does it have to be 0.0.0.0 or can it be ::? (using fastify)
Brody
Brodyβ€’13mo ago
:: works yep
ethan
ethanOPβ€’13mo 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β€’13mo ago
all set?
ethan
ethanOPβ€’13mo ago
yep all set thanks a bunch
Brody
Brodyβ€’13mo ago
no problem πŸ™‚
Want results from more Discord servers?
Add your server