R
Railway12mo ago
lasse

Bun version

What version of bun does railway use?
20 Replies
Percy
Percy12mo ago
Project ID: N/A
lasse
lasse12mo ago
N/A
Fragly
Fragly12mo ago
I think it's 1.0.11
Brody
Brody12mo ago
1.0.11 is not the latest though to use the latest bun version you have to specify the nix archive to use, add this to a nixpacks.toml file in your project.
[phases.setup]
nixpkgsArchive = '5d99e55bbb7e90eef294e7796197ba3cb857cd9e'
[phases.setup]
nixpkgsArchive = '5d99e55bbb7e90eef294e7796197ba3cb857cd9e'
reference: https://github.com/NixOS/nixpkgs/commit/5d99e55bbb7e90eef294e7796197ba3cb857cd9e
Brody
Brody12mo ago
new bun versions come out like every other day lol as of writing this, the nixpacks.toml above will use bun 1.0.14
Fragly
Fragly12mo ago
oh okay
lasse
lasse12mo ago
Altight thank for your help!
Brody
Brody12mo ago
ive updated my message above, when i wrote it the version was 1.0.13, ive updated the commit id to use bun 1.0.14 note that's still not the latest, if you always need the latest you'll want to move to a Dockerfile based build
lasse
lasse12mo ago
Do you have an example of an Dockerfile? Never used it before.
Brody
Brody12mo ago
i do, but i make no promises that it will work out the gate for you
FROM oven/bun:canary

WORKDIR /app

COPY assets /app/assets
COPY src /app/src
COPY bun.lockb package.json tsconfig.json /app/

RUN apt-get update && apt-get install unzip

# Ensure we're 100% on the newest version
RUN bun upgrade --canary

RUN bun i

CMD bun run start
FROM oven/bun:canary

WORKDIR /app

COPY assets /app/assets
COPY src /app/src
COPY bun.lockb package.json tsconfig.json /app/

RUN apt-get update && apt-get install unzip

# Ensure we're 100% on the newest version
RUN bun upgrade --canary

RUN bun i

CMD bun run start
lasse
lasse12mo ago
Thank you!
Brody
Brody12mo ago
give this a read when you need to https://docs.docker.com/engine/reference/builder/
lasse
lasse12mo ago
I will for sure, thanks again brody! It works, gives me the latest version of bun!
Brody
Brody12mo ago
wow that was easy, I put that disclaimer in because I thought it wouldn't work without some modifications
lasse
lasse12mo ago
Haha it does work, just removed COPY assets /app/assets beacuse i dont have an assets folder. But yeah gives me v1.0.16
Brody
Brody12mo ago
awesome
Dayblox
Dayblox3mo ago
For future readers, you can also use the latest commit like so
[phases.setup]
nixpkgsArchive = 'master'
[phases.setup]
nixpkgsArchive = 'master'
Duchess
Duchess2mo ago
New reply sent from Help Station thread:
@lasse I would just dockerize your application and use the bun image in there. This would streamline your deployment to Railway!
You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
Brody, am I understanding correctly that it is impossible to pin to a specific Bun version with Railway's nix implementation?I'd like to avoid the overhead of dockerizing if possible. All we need is to be able to specify bun version.
You're seeing this because this thread has been automatically linked to the Help Station thread.
Brody
Brody2mo ago
you can find the nixpacks comments here to be used as an archive - https://github.com/NixOS/nixpkgs/commits/master/pkgs/development/web/bun/default.nix
GitHub
History for pkgs/development/web/bun/default.nix - NixOS/nixpkgs
Nix Packages collection & NixOS. Contribute to NixOS/nixpkgs development by creating an account on GitHub.
Want results from more Discord servers?
Add your server