R
Railway8mo ago
x4zx

How do I create a config file?

In the documentation for Railway configuration files, I saw that you can use the .toml format Previously I used JSON format, and now I have a little difficulty with the transfer, it is not quite clear how to write it correctly. My early config:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {"nixPkgs": ["...", "nodejs"]},
"install_npm": {"cmds": ["npm ci --include=dev"], "dependsOn": ["setup"]},

"tailwind": {
"cmds": [
"npx tailwindcss -i static/tailwind/input.css -o static/tailwind/output.css"
],
"dependsOn": ["install"]
}
}
}
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {"nixPkgs": ["...", "nodejs"]},
"install_npm": {"cmds": ["npm ci --include=dev"], "dependsOn": ["setup"]},

"tailwind": {
"cmds": [
"npx tailwindcss -i static/tailwind/input.css -o static/tailwind/output.css"
],
"dependsOn": ["install"]
}
}
}
}
}
Desirable:
[build]
builder = "nixpacks"

[deploy]
startCommand = "uvicorn main:app"
restartPolicyType = "never"
[build]
builder = "nixpacks"

[deploy]
startCommand = "uvicorn main:app"
restartPolicyType = "never"
9 Replies
Percy
Percy8mo ago
Project ID: N/A
x4zx
x4zxOP8mo ago
N/A
Brody
Brody8mo ago
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {
"nixPkgs": ["...", "nodejs"]
},
"install_npm": {
"cmds": ["npm ci --include=dev"],
"dependsOn": ["setup"]
},
"tailwind": {
"cmds": ["npx tailwindcss -i static/tailwind/input.css -o static/tailwind/output.css"],
"dependsOn": ["install"]
}
}
}
},
"deploy": {
"startCommand": "uvicorn main:app",
"restartPolicyType": "NEVER"
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {
"nixPkgs": ["...", "nodejs"]
},
"install_npm": {
"cmds": ["npm ci --include=dev"],
"dependsOn": ["setup"]
},
"tailwind": {
"cmds": ["npx tailwindcss -i static/tailwind/input.css -o static/tailwind/output.css"],
"dependsOn": ["install"]
}
}
}
},
"deploy": {
"startCommand": "uvicorn main:app",
"restartPolicyType": "NEVER"
}
}
unless you wanted to remove the node stuff?
x4zx
x4zxOP8mo ago
I must have misspoken, I need to migrate the old json config to toml format
Brody
Brody8mo ago
why? json is definitely better for this
x4zx
x4zxOP8mo ago
It seemed like a better option to me
Brody
Brody8mo ago
you dont get auto complete in vscode with the toml file
x4zx
x4zxOP8mo ago
But if you say that json option is optimal, then I will trust your decision
Brody
Brody8mo ago
thank you
Want results from more Discord servers?
Add your server