a year ago
My NodeJS project needs Deno as well (to execute customer code in a sandbox). I can write a Dockerfile to use the node image and bring in the Deno executable, but I was wondering if this can be done in the dashboard, or in via a Nixpack config change?
Here's the railway.json so far
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": [
"...",
"deno"
]
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Project ID: ac35f6d4-75b3-485b-9991-499bf2b68d3b
0 Replies
a year ago
try this -
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"nixPkgs": [
"...",
"deno"
]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Thanks. I see a build failure with this though. There's a conflict with the Deno executable.
See this output.
╔════════════ Nixpacks v1.21.2 ═══════════╗
║ deno:setup │ deno ║
║─────────────────────────────────────────║
║ setup │ nodejs_18, npm-9_x, deno ║
║─────────────────────────────────────────║
║ install │ npm ci ║
║─────────────────────────────────────────║
║ build │ npm run build ║
║─────────────────────────────────────────║
║ start │ HOST=0.0.0.0 npm run start ║
╚═════════════════════════════════════════╝
...snip...
#10 19.09 these 6 derivations will be built:
#10 19.09 /nix/store/csb3sqga2w44j1a6n464hwslys7xkzx7-npm-9.9.3.tgz.drv
#10 19.09 /nix/store/76ym75lx9mg386lmzg605rmgpk708k4z-npm.drv
#10 19.09 /nix/store/fffnygd90xk1ymy1xd7iw89gbw8sk5jx-builder.pl.drv
#10 19.09 /nix/store/lqd25firjmxvr7w1s20njzc5mb2clqq5-libraries.drv
#10 19.09 /nix/store/ya3rlp59328vqal7m4i6z0xm57lqakjq-bf744fe90419885eefced41b3e5ae442d732712d-env.drv
#10 19.09 /nix/store/rl1bzh4c4qalvgyng83rv0i45bid2r6c-bf744fe90419885eefced41b3e5ae442d732712d-env.drv
#10 19.09 these 82 paths will be fetched (133.98 MiB download, 607.88 MiB unpacked):
...snip...
#10 19.09 /nix/store/1dsk5j6cl0x1p1fhqs5ags1qdc51hraj-deno-1.38.0
...snip...
#10 19.09 /nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2
...snip...
#10 28.34 error: Unable to build profile. There is a conflict for the following files:
#10 28.34
#10 28.34 /nix/store/4ky0adziza8yy3xpq97jp17hqdgrgi60-deno-1.36.0/bin/deno
#10 28.34 /nix/store/gkr76pzx9c4d125kf81sghpflxv177x8-bf744fe90419885eefced41b3e5ae442d732712d-env/bin/deno
#10 28.41 error: builder for '/nix/store/zk8qlm7iih7vcgbq3afdybxi4d9qyw9k-user-environment.drv' failed with exit code 1
a year ago
i have updated this, please try again
I'll try this, thanks. Alternatively, can we add an equivalent of the following into the JSON?
[phases.install]
cmds=["...", "curl -fsSL https://deno.land/install.sh | sh"]
a year ago
you can do something like that, but not in the install phase, that also uses incorrect syntax afaik
I tried the cmd thing and it worked well!
Here's the JSON if someone else needs it.
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"aptPkgs": ["...", "unzip"],
"cmds": [
"...",
"curl -fsSL https://deno.land/install.sh | sh"
]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
a year ago
did the latest railway.json i gave not work?
a year ago
can you send the build logs from it
a year ago
interesting