8 months ago
We are unable to deploy nextjs app, its under web folder of a monorepo.
2 Replies
8 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
8 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 8 months ago
8 months ago
Tell Railway to use
web/as your app root
In your Railway project → Settings → Deployment → Root Directory, set:webSet your Build & Start commands
Still under Deployment, update:Build Command: npm install && npm run build Start Command: npm run startEnsure your
web/package.jsonhas the right scripts{ "scripts": { "build": "next build", "start": "next start" } }(Railway will run those from inside
web/, so it will findpackage.jsonand produce the.nextfolder.)Redeploy
Hit Deploy (or push a dummy commit). You should see› Building… › Production build in .next ready › Starting…and your app will go live.
That’s it—no extra Dockerfiles or hacks. Railway will look under web/, run npm run build, generate .next, then npm run start.