File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Railway Deployment with Nixpacks
2+
3+ This version uses Railway's native Nixpacks builder instead of Docker to avoid registry timeout issues.
4+
5+ ## How It Works
6+
7+ 1 . ** Nixpacks Builder** : Railway's native builder (no Docker registry required)
8+ 2 . ** Frontend Build** : Next.js builds to static files
9+ 3 . ** Backend Build** : TypeScript compiles to JavaScript
10+ 4 . ** Demo Mode** : Runs without Docker scenarios initially
11+
12+ ## Deployment Steps
13+
14+ 1 . ** Push to GitHub** (already done)
15+ 2 . ** Deploy to Railway** :
16+ - Connect your GitHub repo
17+ - Railway will auto-detect and use Nixpacks
18+ - No environment variables needed
19+ 3 . ** Access** : Visit your Railway URL
20+
21+ ## What Works
22+
23+ ✅ ** Frontend** : Full Next.js application
24+ ✅ ** Backend** : WebSocket server for future scenarios
25+ ✅ ** Demo Mode** : Shows friendly message for scenarios
26+ ✅ ** Fast Build** : No Docker registry downloads
27+
28+ ## Adding Docker Later
29+
30+ When you need full scenario support:
31+ 1 . Rename ` Dockerfile.backup ` to ` Dockerfile `
32+ 2 . Update ` railway.toml ` to use ` dockerfile ` builder
33+ 3 . Deploy to a Docker-enabled platform (or wait for Railway Docker support)
34+
35+ ## Benefits
36+
37+ - ** No registry timeouts**
38+ - ** Faster builds**
39+ - ** Railway's optimized Node.js environment**
40+ - ** Perfect for demos and frontend showcasing**
41+
42+ This gets your platform live immediately! 🚀
File renamed without changes.
Original file line number Diff line number Diff line change 1+ [phases .build ]
2+ cmds = [
3+ " npm ci" ,
4+ " npm run build"
5+ ]
6+
7+ [phases .start ]
8+ cmd = " npm run railway:start"
9+
10+ [variables ]
11+ NODE_ENV = " production"
Original file line number Diff line number Diff line change 44 "description" : " DevOps Learning Platform - Learn by Fixing Broken Things" ,
55 "scripts" : {
66 "dev" : " next dev" ,
7- "build" : " next build && npm run build:server" ,
7+ "build" : " next build && npm run build:server && npm run setup:public " ,
88 "build:server" : " cd src/server && npm install && npm run build" ,
9+ "setup:public" : " mkdir -p src/server/public && cp -r out/* src/server/public/" ,
910 "start" : " next start" ,
1011 "start:server" : " cd src/server && npm start" ,
1112 "export" : " next export" ,
1213 "lint" : " next lint" ,
1314 "test" : " jest" ,
1415 "typecheck" : " tsc --noEmit" ,
15- "railway:start" : " cd src/server && node dist/index.js"
16+ "railway:start" : " npm run build && cd src/server && node dist/index.js"
1617 },
1718 "dependencies" : {
1819 "@radix-ui/react-dialog" : " ^1.0.5" ,
Original file line number Diff line number Diff line change 11[build ]
2- builder = " dockerfile"
3- dockerfilePath = " Dockerfile"
2+ builder = " nixpacks"
43
54[deploy ]
6- startCommand = " node index.js "
5+ startCommand = " npm run railway:start "
76 healthcheckPath = " /health"
You can’t perform that action at this time.
0 commit comments