Skip to content

Commit 2812cf4

Browse files
alanopsclaude
andcommitted
Switch to Railway Nixpacks to avoid Docker registry issues
- Remove Dockerfile usage to avoid registry timeouts - Use Railway's native Nixpacks builder instead - Add nixpacks.toml configuration - Update build scripts for Nixpacks deployment - Backup original Dockerfile for future use - This completely avoids Docker Hub connectivity issues Ready for immediate Railway deployment\! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c486c54 commit 2812cf4

5 files changed

Lines changed: 58 additions & 5 deletions

File tree

DEPLOY-NIXPACKS.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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.

nixpacks.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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"

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
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",

railway.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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"

0 commit comments

Comments
 (0)