← スキル一覧に戻る

railway
by hoodini
🧠 AI Agent Skills Repository - A curated collection of specialized skills for AI coding agents (Claude Code, GitHub Copilot, Cursor, Windsurf). Created by Yuval Avidani using GitHub Copilot via VS Code Insiders.
⭐ 54🍴 8📅 2026年1月23日
SKILL.md
name: railway description: Deploy applications on Railway platform. Use when deploying containerized apps, setting up databases, configuring private networking, or managing Railway projects. Triggers on Railway, railway.app, deploy container, Railway database.
Railway Deployment
Deploy and manage applications on Railway's platform.
Quick Start
# Install Railway CLI
npm i -g @railway/cli
# Login
railway login
# Initialize project
railway init
# Deploy
railway up
railway.toml Configuration
[build]
builder = "nixpacks"
buildCommand = "npm run build"
[deploy]
startCommand = "npm start"
healthcheckPath = "/health"
healthcheckTimeout = 300
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 3
[service]
internalPort = 3000
Nixpacks Configuration
# nixpacks.toml
[phases.setup]
nixPkgs = ["nodejs-18_x", "python311"]
[phases.install]
cmds = ["npm ci"]
[phases.build]
cmds = ["npm run build"]
[start]
cmd = "npm start"
Environment Variables
# Set variable
railway variables set DATABASE_URL="postgres://..."
# Set from file
railway variables set < .env
# Link to service
railway service
railway variables set API_KEY="secret"
Database Services
PostgreSQL
# Add PostgreSQL
railway add -d postgres
# Get connection string
railway variables get DATABASE_URL
Redis
railway add -d redis
# Access via REDIS_URL
MySQL
railway add -d mysql
# Access via MYSQL_URL
Private Networking
# Services can communicate via internal DNS
# Format: ${{service-name}}.railway.internal
# Example: API calling database service
DATABASE_HOST: ${{postgres.railway.internal}}
DATABASE_PORT: 5432
Volumes (Persistent Storage)
# Create volume
railway volume create my-data
# Mount in service
railway volume attach my-data:/app/data
In code:
// Data persists across deploys
const dataPath = '/app/data';
fs.writeFileSync(`${dataPath}/file.json`, JSON.stringify(data));
Cron Jobs
# railway.toml
[deploy]
startCommand = "node cron.js"
cronSchedule = "0 */6 * * *" # Every 6 hours
Multi-Service Setup
my-project/
├── api/
│ ├── railway.toml
│ └── ...
├── worker/
│ ├── railway.toml
│ └── ...
└── frontend/
├── railway.toml
└── ...
Deploy each:
cd api && railway up
cd ../worker && railway up
cd ../frontend && railway up
Dockerfile Deploy
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
# railway.toml
[build]
builder = "dockerfile"
dockerfilePath = "./Dockerfile"
Health Checks
// Express health endpoint
app.get('/health', (req, res) => {
res.status(200).json({
status: 'healthy',
timestamp: new Date().toISOString()
});
});
# railway.toml
[deploy]
healthcheckPath = "/health"
healthcheckTimeout = 100
Resources
- Railway Docs: https://docs.railway.app
- Railway CLI: https://docs.railway.app/develop/cli
スコア
総合スコア
55/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です