R
Railway11mo ago
Muijf

Docker build context

How do I set the docker build context? This is useful for monorepo support because it will need the workspaces from the root package.json
3 Replies
Percy
Percy11mo ago
Project ID: N/A
Muijf
MuijfOP11mo ago
N/A
Subaan
Subaan11mo ago
You can do it by connecting the service to the repo and leaving the root directory as the repo root, then you can set dockerfile path in your railway.json/toml like so:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "apps/your-app/Dockerfile"
//
},
"deploy": {
//
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "apps/your-app/Dockerfile"
//
},
"deploy": {
//
}
}
I think you can also set the dockerfile path from the settings ui the above will essentially then run something along the lines of docker build -f apps/your-app/Dockerfile so you can then access all the packages in the repo
Want results from more Discord servers?
Add your server