how to build from mono repo fodler
leon-up9
FREEOP

2 months ago

I have a folder of backend inside the root i want to build and deploy.

I get those errors:
warning emoji The config file format is not yet finalized and subject to change.

warning emoji Script start.sh not found

I was try setting a config file
{

"steps": {

"build": {

"inputs": [

{

"local": true,

"include": ["backend"]

}

],

"commands": [

"pip install -r backend/requirements.txt",

"python backend/build.py"

]

}

}

}

$10 Bounty

2 Replies

Did you specify root directory in service settings?


ilyassbreth
FREE

2 months ago

set root directory first:

  1. go to your service settings in railway and set root directory to backend

  2. your railway.json format is wrong. delete that whole config and create backend/railway.json with:

json

{
  "$schema": "https://railway.com/railway.schema.json",
  "build": {
    "builder": "RAILPACK"
  },
  "deploy": {
    "startCommand": "python main.py"
  }
}

change python main.py to whatever actually runs your backend (like uvicorn main:app --host 0.0.0.0 --port $PORT if you're using fastapi)

the main issue is railway doesn't use that "steps" and "inputs" structure you have. also setting root directory tells railway to only look at your backend folder so it stops looking for start.sh in the wrong place


Loading...