This commit is contained in:
2026-04-12 01:06:31 +07:00
commit 10d660cbcb
1066 changed files with 228596 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
# Deployment Doc Template
After successful deploy, create `docs/deployment.md`:
```markdown
# Deployment
## Platform
[Platform name] — [URL to dashboard]
## Production URL
[https://your-app.example.com]
## Deploy Command
\`\`\`bash
[deploy command here]
\`\`\`
## Environment Variables
| Variable | Description | Required |
|---|---|---|
| NODE_ENV | Environment | Yes |
| DATABASE_URL | Database connection | Yes |
## Custom Domain
[Steps to configure custom domain, if applicable]
## Rollback
\`\`\`bash
[rollback command — e.g., vercel rollback, fly releases, etc.]
\`\`\`
## Troubleshooting
[Common issues and solutions]
```

View File

@@ -0,0 +1,58 @@
# AWS (Amplify / S3 / ECS)
## Amplify Hosting
```bash
npm install -g @aws-amplify/cli
amplify configure
amplify init
amplify publish
```
### Config: amplify.yml
```yaml
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```
### Free Tier (12 months)
1000 build min/mo, 15GB storage, 15GB bandwidth.
After: $0.01/build min, $0.023/GB storage, $0.15/GB served.
## S3 Static Hosting
```bash
aws s3 sync ./dist s3://BUCKET_NAME --delete
aws s3 website s3://BUCKET_NAME --index-document index.html --error-document error.html
```
### Free Tier (12 months)
5GB storage, 20K GET, 2K PUT requests.
## ECS Fargate
```bash
aws ecs update-service --cluster CLUSTER --service SERVICE --force-new-deployment
```
Config: `task-definition.json`. No free tier.
## Detection
- `amplify.yml`, `buildspec.yml` → Amplify
- S3 bucket policy JSON → S3
- `task-definition.json` → ECS
## Best For
- Amplify: static sites + serverless backends
- S3 + CloudFront: cheapest static at scale
- ECS: enterprise containerized workloads

View File

@@ -0,0 +1,41 @@
# Cloudflare Pages / Workers
## CLI
```bash
npm install -g wrangler
wrangler login
# Pages
wrangler pages deploy ./dist --project-name my-app
# Workers
wrangler deploy
```
## Config: wrangler.toml
```toml
name = "my-app"
compatibility_date = "2024-01-01"
# For Workers:
# main = "src/index.ts"
# [vars]
# ENVIRONMENT = "production"
```
## Detection
- `wrangler.toml`, `wrangler.json`
## Free Tier
- Workers: 100K requests/day, 10ms CPU/request
- Pages: unlimited sites, 500 builds/mo, unlimited bandwidth
- D1, R2, KV all have free tiers
## Rollback
```bash
wrangler pages deployment list --project-name my-app
wrangler rollback [deployment-id]
```
## Best For
Edge functions, static sites with global CDN, serverless at edge

View File

@@ -0,0 +1,32 @@
# Coolify (Self-Hosted)
## Setup
```bash
# Install on VPS
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
```
## Deploy
```bash
# Via API
curl -X POST "https://your-coolify.com/api/v1/deploy" \
-H "Authorization: Bearer TOKEN" \
-d '{"uuid": "APP_UUID"}'
# Or via dashboard / Git webhook (auto-deploy)
```
## Detection
- `docker-compose.yml` + Coolify dashboard reference
- Dockerfile, buildpack detection
## Free Tier
- Free (self-hosted, open-source)
- VPS cost only (~$5-6/mo on DO/Vultr, $2.50 on Vultr minimum)
## Rollback
Via dashboard: select previous deployment
## Best For
Teams wanting Heroku-like PaaS on own server. 280+ one-click services.
Multi-server, Docker Swarm support, free SSL via Let's Encrypt.

View File

@@ -0,0 +1,45 @@
# Digital Ocean App Platform
## CLI
```bash
brew install doctl # macOS
snap install doctl # Linux
winget install doctl # Windows
doctl auth init
doctl apps create --spec spec.yaml # new app
doctl apps update APP_ID --spec spec.yaml # update
```
## Config: spec.yaml
```yaml
name: my-app
services:
- name: web
github:
repo: user/repo
branch: main
build_command: npm run build
run_command: npm start
instance_size_slug: basic-xxs
instance_count: 1
http_port: 3000
```
## Detection
- `.do/app.yaml`, `spec.yaml`
- Dockerfile, buildpack detection
## Free Tier
- 3 static sites free
- Dynamic apps from $5/mo
- Droplets (VPS) from $4/mo
## Rollback
```bash
doctl apps list-deployments APP_ID
# Redeploy previous via dashboard or force-rebuild
```
## Best For
Simple full-stack deploys, managed Postgres, free static sites

View File

@@ -0,0 +1,29 @@
# Dokploy (Self-Hosted)
## Setup
```bash
# Install on VPS
curl -sSL https://dokploy.com/install.sh | sh
```
## Deploy
```bash
# Via CLI
dokploy app deploy <app-id>
# Or via webhook trigger / dashboard
```
## Detection
- `dokploy.yml`, Dockerfile, `docker-compose.yml`
## Free Tier
- Free (self-hosted, open-source)
- VPS cost only
## Rollback
Via dashboard: select previous deployment
## Best For
Alternative to Coolify. Docker Compose native support, multi-server Docker Swarm.
Traefik for reverse proxy/SSL. Supports MySQL, PostgreSQL, MongoDB, Redis, MariaDB.

View File

@@ -0,0 +1,54 @@
# Fly.io
## CLI
```bash
# Install (macOS/Linux)
curl -L https://fly.io/install.sh | sh
# Install (Windows)
pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"
fly auth login
fly launch # first time — generates fly.toml
fly deploy # deploy
```
## Config: fly.toml
```toml
app = "my-app"
primary_region = "sjc"
[build]
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = "stop"
auto_start_machines = true
min_machines_running = 0
[[vm]]
memory = "256mb"
cpu_kind = "shared"
cpus = 1
```
## Detection
- `fly.toml` in project root
## Free Tier
- No persistent free tier for new accounts
- One-time trial credit only
- Legacy Hobby: 3x shared VMs + 3GB volume
## Cost Optimize
- `auto_stop_machines = "stop"` + `min_machines_running = 0`
- Avoids idle charges for dev/staging
## Rollback
```bash
fly releases
fly deploy --image registry.fly.io/my-app:PREVIOUS_VERSION
```
## Best For
Dockerized apps, globally distributed apps, Elixir/Phoenix, managed Postgres

View File

@@ -0,0 +1,45 @@
# GCP Cloud Run
## CLI
```bash
curl https://sdk.cloud.google.com | bash
gcloud auth login
gcloud config set project PROJECT_ID
gcloud run deploy SERVICE_NAME \
--image gcr.io/PROJECT/image \
--region us-central1 \
--allow-unauthenticated
```
## Config: cloudbuild.yaml
```yaml
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/my-app', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/my-app']
- name: 'gcr.io/cloud-builders/gcloud'
args: ['run', 'deploy', 'my-app',
'--image', 'gcr.io/$PROJECT_ID/my-app',
'--region', 'us-central1',
'--allow-unauthenticated']
```
## Detection
- `cloudbuild.yaml`, `app.yaml` (GAE format), Dockerfile
## Free Tier (Permanent)
- 2M requests/mo, 180K vCPU-seconds/mo, 360K GiB-seconds/mo
## Cost Optimize
- `--min-instances=0` for scale-to-zero
- Use Artifact Registry instead of GCR
## Rollback
```bash
gcloud run services update-traffic SERVICE --to-revisions=REVISION=100
```
## Best For
Containerized microservices, pay-per-request serverless, burst traffic

View File

@@ -0,0 +1,56 @@
# Github Pages
## CLI
```bash
# Install GitHub CLI
winget install --id GitHub.cli # Windows
brew install gh # macOS
# Deploy via gh-pages package
npm run build
npx gh-pages -d dist
```
## Config: .github/workflows/deploy-pages.yml
```yaml
name: Deploy to GitHub Pages
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci && npm run build
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: dist
- id: deployment
uses: actions/deploy-pages@v4
```
## Detection
- `gh-pages` branch
- `.github/workflows/` with `deploy-pages` or `pages` actions
## Free Tier
- Completely free for public repos
- 1GB repo size, 100GB bandwidth/mo, 10 builds/hr
## Rollback
Revert commit and push, or re-run previous workflow
## Best For
Static sites only — docs, portfolios, project pages. No server-side code.

View File

@@ -0,0 +1,31 @@
# Heroku
## CLI
```bash
npm install -g heroku
heroku login
heroku create my-app
git push heroku main
```
## Config: Procfile
```
web: npm start
```
## Detection
- `Procfile`, `app.json`, buildpack detection
## Free Tier
- None (removed Nov 2022)
- Eco dynos: $5/mo
- In "sustaining engineering mode" since Feb 2026 — no new features
## Rollback
```bash
heroku releases
heroku rollback v123
```
## Best For
Legacy workloads only. Not recommended for new projects — migrate to Railway/Render/Fly.

View File

@@ -0,0 +1,39 @@
# Netlify
## CLI
```bash
npm install -g netlify-cli
netlify login
netlify deploy # draft
netlify deploy --prod # production
netlify deploy --dir=dist --prod # specify build dir
```
## Config: netlify.toml
```toml
[build]
command = "npm run build"
publish = "dist"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
```
## Detection
- `netlify.toml`, `_redirects`, `_headers` files
## Free Tier
- 100GB bandwidth/mo, 300 build min/mo
- 125K function invocations, 10GB storage
- Site suspended if limits exceeded
## Rollback
```bash
netlify deploy --prod --alias=DEPLOY_ID
# Or via dashboard: Deploys → Published deploy → select previous
```
## Best For
Static sites, JAMstack, serverless functions

View File

@@ -0,0 +1,38 @@
# Railway
## CLI
```bash
npm i -g @railway/cli
# or: curl -fsSL https://railway.com/install.sh | sh
railway login
railway up
```
## Config: railway.toml
```toml
[build]
buildCommand = "npm run build"
[deploy]
startCommand = "npm start"
healthcheckPath = "/"
restartPolicyType = "ON_FAILURE"
```
## Detection
- `railway.toml`, `railway.json`
- Auto-detects via Railpack (language/framework)
## Free Tier
- No free tier (removed 2024)
- $5 one-time trial credit (expires 30 days)
- Hobby plan: $5/mo + usage
## Rollback
```bash
railway service rollback
# Or via dashboard: Deployments → select previous
```
## Best For
Full-stack apps, databases, background workers, private networking

View File

@@ -0,0 +1,39 @@
# Render
## CLI
No official CLI. Deploy via Git push or API.
```bash
# Git push to connected branch (auto-deploy)
git push origin main
# API trigger
curl -X POST "https://api.render.com/deploy/srv-XXXXX?key=YOUR_KEY"
```
## Config: render.yaml
```yaml
services:
- type: web
name: my-app
runtime: node
buildCommand: npm install && npm run build
startCommand: npm start
envVars:
- key: NODE_ENV
value: production
```
## Detection
- `render.yaml` in repo root
## Free Tier
- 750 free instance hours/mo (Starter)
- Free PostgreSQL (90 days)
- Spins down after 15min idle (30s cold start)
## Rollback
Via dashboard: Events → select previous deploy → Manual Deploy
## Best For
Full-stack apps, background workers, cron jobs, managed PostgreSQL

View File

@@ -0,0 +1,35 @@
# TOSE.sh
## CLI
```bash
npm install -g @tosesh/tose
tose login [--api-key <key>]
tose whoami
tose init # link project
tose up # deploy (init + git + env + deploy)
tose env push # push .env to TOSE
tose env pull # pull env from TOSE
tose env [action] [project] # Manage environment variables
tose domain [action] [project] # Manage custom domains for your project
tose generate # AI-powered Dockerfile generation
tose status [project] # Show project status and pod health
tose logs [project] [options] # View build logs or stream live application logs.
tose down [project] [-y] # Stop deployments or restart pods.
```
## Detection
- `tose.yaml`, `tose.json` (if exists)
- User runs `tose init` to link directory
## Free Tier
- $10 signup credit, no credit card required
- After credit: ~$21.90/mo (1vCPU+1GB)
- Discounts at $100+ (10%) and $200+ (20%) balance
- Unlimited bandwidth, no hidden fees
## Rollback
Via TOSE dashboard — select previous deployment
## Best For
Docker-based full-stack apps, Vietnamese-region deployments, any Docker container
Supports: Next.js, React, Vue, Nuxt, Svelte, Node.js, Python, Go

View File

@@ -0,0 +1,37 @@
# Vercel
## CLI
```bash
npm i -g vercel
vercel login
vercel # preview
vercel --prod # production
```
## Config: vercel.json
```json
{
"buildCommand": "npm run build",
"outputDirectory": "dist",
"framework": null,
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}
```
## Detection
- `vercel.json`, `.vercel/` directory
- Auto-detects Next.js, Vite, Remix frameworks
## Free Tier (Hobby)
- 100GB bandwidth/mo, 1M edge requests/mo
- Non-commercial use only
- 10s function timeout
- Commercial requires Pro ($20/mo)
## Rollback
```bash
vercel rollback [deployment-url]
```
## Best For
Frontend frameworks (Next.js first-class), serverless APIs, SPAs

View File

@@ -0,0 +1,27 @@
# Vultr
## CLI
```bash
# Install
go install github.com/vultr/vultr-cli/v3@latest
# or download binary from GitHub releases
# Auth (uses env var)
export VULTR_API_KEY="your-api-key"
vultr-cli instance list
# Create instance (IaaS — no PaaS deploy)
vultr-cli instance create --region ewr --plan vc2-1c-1gb --os 387
```
## Detection
- N/A (raw VPS/Kubernetes, no project-level config)
## Free Tier
- None. Cheapest: $2.50/mo (VX1, 1vCPU, 0.5GB RAM)
- VKE (Kubernetes): free control plane, pay for nodes
## Best For
Raw VPS, Kubernetes (VKE), bare metal.
Pair with Coolify/Dokploy for PaaS experience.
One-click Coolify from Vultr Marketplace.