{
 "Compose 基礎:compose.yaml 與常用指令#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   4,
   4,
   5
  ],
  "nodes": [
   {
    "label": "網站"
   },
   {
    "label": "資料庫"
   },
   {
    "label": "快取"
   },
   {
    "label": "反向代理"
   },
   {
    "label": "compose.yaml",
    "sub": "一個指令全部啟動",
    "kind": "end"
   }
  ]
 },
 "Compose 基礎:compose.yaml 與常用指令#2": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "項目",
   "現行",
   "過時"
  ],
  "rows": [
   [
    "指令",
    "docker compose",
    "docker-compose"
   ],
   [
    "檔名",
    "compose.yaml",
    "其他舊檔名"
   ],
   [
    "格式",
    "Compose Specification",
    "version 欄位"
   ]
  ]
 },
 "Compose 基礎:compose.yaml 與常用指令#3": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   1,
   2,
   3,
   3,
   4,
   4
  ],
  "nodes": [
   {
    "label": "image",
    "sub": "nginx"
   },
   {
    "label": "ports",
    "sub": "8080:80"
   },
   {
    "label": "volumes",
    "sub": "./site 唯讀"
   },
   {
    "label": "up -d",
    "sub": "背景啟動",
    "kind": "end"
   }
  ]
 },
 "Compose 基礎:compose.yaml 與常用指令#4": {
  "type": "table",
  "reveal": [
   4,
   4,
   5,
   6,
   7,
   8,
   9
  ],
  "head": [
   "欄位",
   "用途"
  ],
  "rows": [
   [
    "build",
    "從 Dockerfile 建置"
   ],
   [
    "image",
    "映像檔名稱"
   ],
   [
    "command",
    "覆蓋 CMD"
   ],
   [
    "environment",
    "直接寫環境變數"
   ],
   [
    "env_file",
    "從檔案讀入變數"
   ],
   [
    "ports",
    "埠的對應"
   ],
   [
    "volumes",
    "掛載"
   ],
   [
    "networks",
    "加入網路"
   ],
   [
    "depends_on",
    "等服務先啟動"
   ]
  ]
 },
 "Compose 基礎:compose.yaml 與常用指令#7": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "services",
    "points": [
     "定義每個服務"
    ]
   },
   {
    "title": "volumes",
    "points": [
     "宣告具名 volume"
    ]
   },
   {
    "title": "networks",
    "points": [
     "宣告自訂網路"
    ]
   }
  ]
 },
 "環境變數、健康檢查、啟動順序與 secrets#1": {
  "type": "table",
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   3
  ],
  "head": [
   "語法",
   "意思"
  ],
  "rows": [
   [
    "${VAR}",
    "取值;未設定為空並警告"
   ],
   [
    "${VAR:-預設}",
    "未設定或空,用預設值"
   ],
   [
    "${VAR:?訊息}",
    "未設定就中止並報錯"
   ]
  ]
 },
 "環境變數、健康檢查、啟動順序與 secrets#4": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "服務 secrets",
    "sub": "列出要用的"
   },
   {
    "label": "_FILE 變數",
    "sub": "/run/secrets"
   },
   {
    "label": "頂層 secrets",
    "sub": "指向主機檔案"
   },
   {
    "label": "機密檔",
    "sub": "權限嚴格",
    "kind": "end"
   }
  ]
 },
 "環境變數、健康檢查、啟動順序與 secrets#5": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   2,
   2
  ],
  "head": [
   "寫法",
   "保證什麼"
  ],
  "rows": [
   [
    "depends_on 列 db",
    "只保證先啟動"
   ],
   [
    "service_healthy",
    "等 db 健康才啟動"
   ]
  ]
 },
 "環境變數、健康檢查、啟動順序與 secrets#6": {
  "type": "table",
  "reveal": [
   0,
   0,
   4,
   4
  ],
  "head": [
   "healthcheck",
   "值"
  ],
  "rows": [
   [
    "interval",
    "10s"
   ],
   [
    "timeout",
    "5s"
   ],
   [
    "retries",
    "5"
   ],
   [
    "start_period",
    "30s"
   ]
  ]
 },
 "環境變數、健康檢查、啟動順序與 secrets#7": {
  "type": "table",
  "reveal": [
   0,
   0,
   1,
   2,
   3
  ],
  "head": [
   "設定",
   "值",
   "意思"
  ],
  "rows": [
   [
    "restart",
    "unless-stopped",
    "掛了或重開機自動起"
   ],
   [
    "mem_limit",
    "512m",
    "記憶體上限"
   ],
   [
    "cpus",
    "0.5",
    "最多半顆處理器"
   ]
  ]
 },
 "設計多服務應用:架構與維運要點#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   1,
   2,
   2,
   3,
   3,
   4
  ],
  "nodes": [
   {
    "label": "使用者"
   },
   {
    "label": "proxy",
    "sub": "nginx,80:80"
   },
   {
    "label": "app",
    "sub": "根目錄唯讀"
   },
   {
    "label": "DB",
    "sub": "db-data volume",
    "kind": "end"
   }
  ]
 },
 "設計多服務應用:架構與維運要點#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "單一入口",
    "points": [
     "只有 proxy 發布埠"
    ]
   },
   {
    "title": "分層網路",
    "points": [
     "frontend",
     "backend internal"
    ]
   },
   {
    "title": "資料與機密",
    "points": [
     "具名 volume",
     "secrets"
    ]
   },
   {
    "title": "縮小範圍",
    "points": [
     "app 唯讀",
     "tmpfs 暫存"
    ]
   }
  ]
 },
 "設計多服務應用:架構與維運要點#3": {
  "type": "table",
  "reveal": [
   0,
   1,
   2
  ],
  "head": [
   "項目",
   "做法"
  ],
  "rows": [
   [
    "第五",
    "restart: unless-stopped"
   ],
   [
    "第六",
    "app 等 db 健康才啟動"
   ]
  ]
 },
 "設計多服務應用:架構與維運要點#7": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "固定名稱/埠",
    "sub": "無法擴充"
   },
   {
    "label": "--scale app=3",
    "sub": "三個副本"
   },
   {
    "label": "反向代理",
    "sub": "分配流量",
    "kind": "end"
   }
  ]
 }
}