[{"data":1,"prerenderedAt":624},["ShallowReactive",2],{"navigation_docs":3,"-web-dev-infrastructure-ecs-docker-kubernetes-stack":352,"-web-dev-infrastructure-ecs-docker-kubernetes-stack-surround":619},[4,54,83,116,125,161,179,200],{"title":5,"path":6,"stem":7,"children":8},"Ai","/ai","ai",[9,12,42,46,50],{"title":10,"path":6,"stem":11},"AI 技術探索","ai/index",{"title":13,"path":14,"stem":15,"children":16,"page":41},"Rag","/ai/rag","ai/RAG",[17,21,25,29,33,37],{"title":18,"path":19,"stem":20},"BM25 演算法深入解析：從 TF-IDF 到現代搜尋引擎的核心技術","/ai/rag/bm25-deep-dive-from-tf-idf-to-rag","ai/RAG/bm25-deep-dive-from-tf-idf-to-rag",{"title":22,"path":23,"stem":24},"Dense Retrieval（向量檢索）深入解析","/ai/rag/dense-retrieval-deep-dive","ai/RAG/dense-retrieval-deep-dive",{"title":26,"path":27,"stem":28},"RAG（Retrieval-Augmented Generation）原理與實作入門","/ai/rag/rag-intro-principles-and-implementation","ai/RAG/rag-intro-principles-and-implementation",{"title":30,"path":31,"stem":32},"RAG Retrieval Strategy 深入解析","/ai/rag/rag-retrieval-strategy-deep-dive","ai/RAG/rag-retrieval-strategy-deep-dive",{"title":34,"path":35,"stem":36},"Reciprocal Rank Fusion（RRF）教學：打造更穩定的檢索融合策略","/ai/rag/rrf-reciprocal-rank-fusion-guide","ai/RAG/rrf-reciprocal-rank-fusion-guide",{"title":38,"path":39,"stem":40},"TF-IDF（Term Frequency–Inverse Document Frequency）深入解析","/ai/rag/tf-idf-deep-dive","ai/RAG/tf-idf-deep-dive",false,{"title":43,"path":44,"stem":45},"Docus AI 功能完整實作指南","/ai/docus-ai-implementation","ai/docus-ai-implementation",{"title":47,"path":48,"stem":49},"llms.txt 是什麼？在 Nuxt 中控制 AI 與搜尋引擎爬蟲的新方式","/ai/llms-txt","ai/llms-txt",{"title":51,"path":52,"stem":53},"MCP（Model Context Protocol）是什麼？用「AI 的 USB-C」理解模型如何安全連接工具與資料","/ai/mcp_concept","ai/mcp_concept",{"title":55,"path":56,"stem":57,"children":58,"page":41},"Data Analysis","/data-analysis","data-analysis",[59,63,67,71,75,79],{"title":60,"path":61,"stem":62},"Exploratory Data Analysis（EDA）資料探索分析入門","/data-analysis/exploratory-data-analysis-eda","data-analysis/exploratory-data-analysis-eda",{"title":64,"path":65,"stem":66},"PR-AUC 深入解析：不平衡分類問題的重要評估指標","/data-analysis/pr-auc-for-imbalanced-classification","data-analysis/pr-auc-for-imbalanced-classification",{"title":68,"path":69,"stem":70},"ROC-AUC 深入解析：理解分類模型的判斷能力","/data-analysis/roc-auc-complete-guide","data-analysis/roc-auc-complete-guide",{"title":72,"path":73,"stem":74},"SHAP（SHapley Additive exPlanations）模型解釋方法深入解析","/data-analysis/shap-model-interpretation-complete-guide","data-analysis/shap-model-interpretation-complete-guide",{"title":76,"path":77,"stem":78},"Social Network Analysis（SNA）深入解析","/data-analysis/social-network-analysis-sna","data-analysis/social-network-analysis-sna",{"title":80,"path":81,"stem":82},"Time-based Split：為什麼時間序列資料不能使用 Random Split？","/data-analysis/time-based-split-vs-random-split","data-analysis/time-based-split-vs-random-split",{"title":84,"path":85,"stem":86,"children":87,"page":41},"MachineLearning","/machine_learning","machine_learning",[88,92,96,100,104,108,112],{"title":89,"path":90,"stem":91},"Confusion Matrix（混淆矩陣）完整解析","/machine_learning/confusion-matrix","machine_learning/confusion-matrix",{"title":93,"path":94,"stem":95},"Decision Tree 模型完整教學：從原理到 Python 實作","/machine_learning/decision-tree-complete-guide","machine_learning/decision-tree-complete-guide",{"title":97,"path":98,"stem":99},"為什麼 Decision Tree 在 Tabular Data 上常常勝過 Deep Learning？","/machine_learning/decision-tree-vs-deep-learning-on-tabular-data","machine_learning/decision-tree-vs-deep-learning-on-tabular-data",{"title":101,"path":102,"stem":103},"LightGBM 模型入門：理解高效能的 Gradient Boosting 演算法","/machine_learning/lightgbm-intro-for-tabular-data","machine_learning/lightgbm-intro-for-tabular-data",{"title":105,"path":106,"stem":107},"Logistic Regression（Logit 回歸）完整教學","/machine_learning/logistic-regression-complete-guide","machine_learning/logistic-regression-complete-guide",{"title":109,"path":110,"stem":111},"為什麼模型訓練需要 Train / Validation / Test Dataset？","/machine_learning/train-validation-test-dataset","machine_learning/train-validation-test-dataset",{"title":113,"path":114,"stem":115},"XGBoost 原理與實務教學","/machine_learning/xgboost-complete-guide","machine_learning/xgboost-complete-guide",{"title":117,"path":118,"stem":119,"children":120,"page":41},"Network","/network","network",[121],{"title":122,"path":123,"stem":124},"DNS 設定入門：CNAME vs A Record 完整解析","/network/dns-cname-vs-a-record-guide","network/dns-cname-vs-a-record-guide",{"title":126,"path":127,"stem":128,"children":129},"Nuxt","/nuxt","nuxt",[130,133,137,141,145,149,153,157],{"title":131,"path":127,"stem":132},"Nuxt 實戰指南","nuxt/index",{"title":134,"path":135,"stem":136},"Abstraction Layer 與 Adapter 的差別，一次搞懂設計角色","/nuxt/adapter_abstraction_layer","nuxt/adapter_abstraction_layer",{"title":138,"path":139,"stem":140},"Nuxt 4 全面理解 — 專案檔案結構解析","/nuxt/directory_structure","nuxt/directory_structure",{"title":142,"path":143,"stem":144},"Nuxt 前端 build 流程完整解析","/nuxt/frontend_build","nuxt/frontend_build",{"title":146,"path":147,"stem":148},"Nitro 是什麼？從 Nuxt 專案到 Server 與 Edge 的關鍵引擎","/nuxt/nitro","nuxt/nitro",{"title":150,"path":151,"stem":152},"深入理解 Nuxt 的 .nuxt 與 .output：為什麼部署時一定要分清楚？","/nuxt/nuxt_and_output","nuxt/nuxt_and_output",{"title":154,"path":155,"stem":156},"Nuxt 中 dev、build、preview 的差異一次搞懂","/nuxt/nuxt_dev_build_preview","nuxt/nuxt_dev_build_preview",{"title":158,"path":159,"stem":160},"Nuxt Image vs \u003Cimg>：為什麼 Nuxt 3 專案幾乎都該用 \u003CNuxtImg>？","/nuxt/nuxt_image","nuxt/nuxt_image",{"title":162,"path":163,"stem":164,"children":165},"Python 程式開發","/python","python/index",[166,167,171,175],{"title":162,"path":163,"stem":164},{"title":168,"path":169,"stem":170},"如何在 FastAPI 中調用記憶體 Buffer 回傳圖片 (附實例)","/python/memory_buffer","python/memory_buffer",{"title":172,"path":173,"stem":174},"Python 單元測試教學：如何為你的程式撰寫 Test","/python/python-unit-testing-unittest-pytest","python/python-unit-testing-unittest-pytest",{"title":176,"path":177,"stem":178},"如何使用 uv 取代 pip：改善 Python 專案的開發流程","/python/uv","python/uv",{"title":180,"path":181,"stem":182,"children":183,"page":41},"Statistic","/statistic","statistic",[184,188,192,196],{"title":185,"path":186,"stem":187},"卡方檢定（Chi-Square Test）入門教學","/statistic/chi-square-test-intro","statistic/chi-square-test-intro",{"title":189,"path":190,"stem":191},"常見抽樣方法（Sampling Methods）教學：Stratified、Quota、Convenience、Systematic、Simple Random","/statistic/common-sampling-methods-guide","statistic/common-sampling-methods-guide",{"title":193,"path":194,"stem":195},"Cramér’s V 指標介紹：如何衡量兩個類別變數之間的關聯","/statistic/cramers-v-for-categorical-association","statistic/cramers-v-for-categorical-association",{"title":197,"path":198,"stem":199},"Mann–Whitney U 與 Kolmogorov–Smirnov（KS）檢定：非參數統計檢定的入門指南","/statistic/mann-whitney-u-and-ks-test-intro","statistic/mann-whitney-u-and-ks-test-intro",{"title":201,"path":202,"stem":203,"children":204},"WebDev","/web_dev","web_dev",[205,208,234,248,282,312,334],{"title":206,"path":202,"stem":207},"Web 前端開發","web_dev/index",{"title":209,"path":210,"stem":211,"children":212},"瀏覽器與渲染","/web_dev/browser","web_dev/browser/index",[213,214,218,222,226,230],{"title":209,"path":210,"stem":211},{"title":215,"path":216,"stem":217},"瀏覽器儲存空間完整解析：Cookie、localStorage、IndexedDB 到 Cache Storage","/web_dev/browser/browser-storage-comprehensive-guide","web_dev/browser/browser-storage-comprehensive-guide",{"title":219,"path":220,"stem":221},"DOM (Document Object Model) 深入解析","/web_dev/browser/dom","web_dev/browser/dom",{"title":223,"path":224,"stem":225},"Service Worker Request Flow 深入解析","/web_dev/browser/service-worker-request-flow","web_dev/browser/service-worker-request-flow",{"title":227,"path":228,"stem":229},"CSR、SSR 與 SSG 是什麼？前端渲染策略完整比較","/web_dev/browser/ssr_csr_ssg","web_dev/browser/ssr_csr_ssg",{"title":231,"path":232,"stem":233},"Virtual DOM 深入解析：為什麼它能優化前端效能？","/web_dev/browser/virtual_dom","web_dev/browser/virtual_dom",{"title":235,"path":236,"stem":237,"children":238},"圖形技術","/web_dev/graphics","web_dev/graphics/index",[239,240,244],{"title":235,"path":236,"stem":237},{"title":241,"path":242,"stem":243},"為什麼 Three.js 專案幾乎都選擇 CSR？從 SSR 問題談起","/web_dev/graphics/threejs_csr","web_dev/graphics/threejs_csr",{"title":245,"path":246,"stem":247},"WebGL 是什麼？為什麼前端 3D 幾乎都靠它？","/web_dev/graphics/webgl","web_dev/graphics/webGL",{"title":249,"path":250,"stem":251,"children":252},"架構與配置","/web_dev/infrastructure","web_dev/infrastructure/index",[253,254,258,262,266,270,274,278],{"title":249,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"Zeabur + K3s + Nuxt 部署架構完整解析","/web_dev/infrastructure/k3s-zeabur","web_dev/infrastructure/K3s-zeabur",{"title":259,"path":260,"stem":261},"ECS vs Docker vs Kubernetes：從部署堆疊理解三層架構","/web_dev/infrastructure/ecs-docker-kubernetes-stack","web_dev/infrastructure/ecs-docker-kubernetes-stack",{"title":263,"path":264,"stem":265},"ECS vs VPS 是什麼？從部署網站的角度一次搞懂差別","/web_dev/infrastructure/ecs-vs-vps","web_dev/infrastructure/ecs-vs-vps",{"title":267,"path":268,"stem":269},"Zeabur 內網服務連線完整入門指南","/web_dev/infrastructure/k3s-internal-networking","web_dev/infrastructure/k3s-internal-networking",{"title":271,"path":272,"stem":273},"使用 Microservices 架構設計系統的優勢解析","/web_dev/infrastructure/microservices-architecture-advantages","web_dev/infrastructure/microservices-architecture-advantages",{"title":275,"path":276,"stem":277},"Nginx 入門教學：從反向代理到與 Kubernetes 的架構比較","/web_dev/infrastructure/nginx-intro","web_dev/infrastructure/nginx-intro",{"title":279,"path":280,"stem":281},"YAML 配置是什麼？為什麼現代開發都在用它","/web_dev/infrastructure/yaml-configuration","web_dev/infrastructure/yaml-configuration",{"title":283,"path":284,"stem":285,"children":286},"網絡與通訊","/web_dev/network","web_dev/network/index",[287,288,292,296,300,304,308],{"title":283,"path":284,"stem":285},{"title":289,"path":290,"stem":291},"HTTP Request 結構完整解析：從 Request Line 到 Header 一次看懂","/web_dev/network/http-request-structure","web_dev/network/http-request-structure",{"title":293,"path":294,"stem":295},"OSI 模型（Open Systems Interconnection Model）完整解析","/web_dev/network/osi-model","web_dev/network/osi-model",{"title":297,"path":298,"stem":299},"RESTful API 設計原則與實務解析","/web_dev/network/restful-api","web_dev/network/restful-api",{"title":301,"path":302,"stem":303},"RESTful API 五大設計原則深入解析","/web_dev/network/restful-api-principles","web_dev/network/restful-api-principles",{"title":305,"path":306,"stem":307},"Server-Sent Events (SSE) 深入解析與實作教學","/web_dev/network/sse-introduction","web_dev/network/sse-introduction",{"title":309,"path":310,"stem":311},"WebSocket 入門教學：從概念到 Node.js 實作","/web_dev/network/websocket-introduction","web_dev/network/websocket-introduction",{"title":313,"path":314,"stem":315,"children":316},"認證與安全","/web_dev/security","web_dev/security/index",[317,318,322,326,330],{"title":313,"path":314,"stem":315},{"title":319,"path":320,"stem":321},"使用 Cookie 與 Session 建立使用者驗證（完整新手教學）","/web_dev/security/cookie-session-authentication","web_dev/security/cookie-session-authentication",{"title":323,"path":324,"stem":325},"JWT 驗證機制完整解析：從登入流程到實務應用","/web_dev/security/jwt-authentication","web_dev/security/jwt-authentication",{"title":327,"path":328,"stem":329},"Secret Key 簽名是什麼？從零理解資料簽名的本質","/web_dev/security/secret-key-signing","web_dev/security/secret-key-signing",{"title":331,"path":332,"stem":333},"SSH（Secure Shell）是什麼？從遠端登入到安全通道的核心概念","/web_dev/security/ssh","web_dev/security/ssh",{"title":335,"path":336,"stem":337,"children":338},"SEO 與規範","/web_dev/seo","web_dev/seo/index",[339,340,344,348],{"title":335,"path":336,"stem":337},{"title":341,"path":342,"stem":343},"Canonical URL 是什麼？用生活化方式搞懂前端 SEO 的基本保命符","/web_dev/seo/canonical_link","web_dev/seo/canonical_link",{"title":345,"path":346,"stem":347},"robots.txt 是什麼？SEO 的第一道守門員","/web_dev/seo/robot_txt","web_dev/seo/robot_txt",{"title":349,"path":350,"stem":351},"Nuxt SEO 中的 Meta 與 SEO 工具是如何運作的？","/web_dev/seo/seo","web_dev/seo/seo",{"id":353,"title":259,"body":354,"description":605,"extension":606,"links":607,"meta":608,"navigation":616,"path":260,"seo":617,"stem":261,"__hash__":618},"docs/web_dev/infrastructure/ecs-docker-kubernetes-stack.md",{"type":355,"value":356,"toc":590},"minimark",[357,361,365,373,376,390,393,396,401,407,410,413,415,419,425,428,433,446,452,454,458,461,465,497,500,502,505,508,547,549,552,572,574,577,580,587],[358,359,259],"h1",{"id":360},"ecs-vs-docker-vs-kubernetes從部署堆疊理解三層架構",[362,363,364],"p",{},"在學習後端部署或雲端架構時，很多人會把 ECS、Docker 與 Kubernetes 混在一起討論，甚至誤以為它們彼此是替代關係。其實這三者屬於完全不同層級的技術，只是因為常常同時出現在部署流程中，才會讓人產生混淆。",[362,366,367,368,372],{},"如果我們換一個角度，從「",[369,370,371],"strong",{},"部署堆疊（Deployment Stack）","」來理解，就會非常清楚。你可以把整個系統拆成三層：基礎設施層、容器層、以及容器協調層。這三層分工明確，各自解決不同問題。",[362,374,375],{},"最核心的關係可以用一句話理解：",[377,378,379],"blockquote",{},[362,380,381,384,387],{},[369,382,383],{},"ECS 提供「電腦」",[369,385,386],{},"Docker 提供「應用程式的打包方式」",[369,388,389],{},"Kubernetes 負責「管理很多 Docker」",[362,391,392],{},"只要把這句話理解透徹，很多部署上的疑問自然會解開。",[394,395],"hr",{},[397,398,400],"h2",{"id":399},"第一層ecs-基礎設施infrastructure","第一層：ECS —— 基礎設施（Infrastructure）",[362,402,403,404],{},"ECS（Elastic Compute Service）本質上就是一台雲端 Linux 主機。無論是 AWS 的 EC2、阿里雲的 ECS，還是 GCP 的 Compute Engine，它們解決的都是同一個問題：",[369,405,406],{},"提供運算資源。",[362,408,409],{},"當你建立一台 ECS，你得到的是一台擁有 CPU、RAM、磁碟與網路的遠端電腦。你可以透過 SSH 連進去，安裝任何你需要的軟體。",[362,411,412],{},"這一層完全不關心你的應用程式怎麼執行，它只負責問：「你要多強大的電腦？」",[394,414],{},[397,416,418],{"id":417},"第二層docker-容器container-runtime","第二層：Docker —— 容器（Container Runtime）",[362,420,421,422],{},"Docker 思考的不是「電腦在哪裡」，而是：",[369,423,424],{},"如何讓應用程式在任何主機上，都能用完全相同的方式執行？",[362,426,427],{},"Docker 把應用程式與它的執行環境（依賴套件、設定檔等）一起「打包」成 Image。這樣一來，開發者就不再需要擔心「在我電腦可以跑，到正式環境卻壞掉」的問題。",[429,430,432],"h3",{"id":431},"docker-的角色","Docker 的角色",[434,435,436,440,443],"ul",{},[437,438,439],"li",{},"負責 Container 的建立與執行。",[437,441,442],{},"負責 Image 的打包與分發。",[437,444,445],{},"提供環境隔離與可重現性。",[362,447,448,451],{},[369,449,450],{},"但 Docker 不負責「管理大量容器」。"," 例如：當你有 100 個 Container 需要運作、需要自動擴展、需要負載平衡時，單純使用 Docker 是不夠的。",[394,453],{},[397,455,457],{"id":456},"第三層kubernetes-容器協調orchestration","第三層：Kubernetes —— 容器協調（Orchestration）",[362,459,460],{},"Kubernetes（常簡稱 K8s）誕生的目的，就是為了解決「大量容器管理」的問題。當系統規模變大，手動管理 Docker 指令會變得極其困難。",[429,462,464],{"id":463},"kubernetes-負責的事情","Kubernetes 負責的事情",[434,466,467,473,479,485,491],{},[437,468,469,472],{},[369,470,471],{},"Scheduling","：決定 Container 應該跑在哪台機器。",[437,474,475,478],{},[369,476,477],{},"Auto Restart","：Container 掛掉時自動重啟。",[437,480,481,484],{},[369,482,483],{},"Auto Scaling","：根據流量自動增加或減少 Container 數量。",[437,486,487,490],{},[369,488,489],{},"Load Balancing","：均勻分配流量到各個 Container。",[437,492,493,496],{},[369,494,495],{},"Rolling Deployment","：實現零停機更新。",[362,498,499],{},"如果說 Docker 是「單機的容器工具」，那 Kubernetes 就是「跨多台機器的管理系統」。",[394,501],{},[397,503,504],{"id":504},"從零到大型系統的真實部署流程",[362,506,507],{},"理解三層關係後，我們來看一個實際的部署演進過程：",[509,510,511,521,531,537],"ol",{},[437,512,513,516,517,520],{},[369,514,515],{},"Step 1","：你先建立一台 ",[369,518,519],{},"ECS / VPS","（土地與建築）。",[437,522,523,526,527,530],{},[369,524,525],{},"Step 2","：你在主機上安裝 ",[369,528,529],{},"Docker","（裝潢出獨立的公寓單位）。",[437,532,533,536],{},[369,534,535],{},"Step 3","：你部署應用程式（讓住戶入住）。這通常是小型專案的終點。",[437,538,539,542,543,546],{},[369,540,541],{},"Step 4","：當專案變大（變成城市量級），你需要 ",[369,544,545],{},"Kubernetes","（物業管理公司）來自動化處理所有單位的修繕、擴建與訪客流量。",[394,548],{},[397,550,551],{"id":551},"用城市比喻理解三層架構",[434,553,554,560,566],{},[437,555,556,559],{},[369,557,558],{},"ECS = 土地與建築物","：提供空間、電力與基礎設施。",[437,561,562,565],{},[369,563,564],{},"Docker = 公寓單位","：每個 Container 是一個獨立且標準化的空間，住著不同的應用程式（Node app, DB, AI Agent 等）。",[437,567,568,571],{},[369,569,570],{},"Kubernetes = 物業管理公司","：負責監控哪些公寓有人住、壞掉自動修、人多時多開幾間、並引導流量。",[394,573],{},[397,575,576],{"id":576},"最重要的總結",[362,578,579],{},"ECS、Docker 與 Kubernetes 不是替代關係，而是分層演進的關係：",[377,581,582],{},[362,583,584],{},[369,585,586],{},"Infrastructure (ECS) → Container (Docker) → Orchestration (Kubernetes)",[362,588,589],{},"當你從「部署堆疊」的角度理解這三層，你就會知道自己現在處於哪一個階段，並能根據專案需求選擇最合適的技術，而不是盲目追求複雜度。理解架構的本質，比學會指令更重要。",{"title":591,"searchDepth":592,"depth":592,"links":593},"",2,[594,595,599,602,603,604],{"id":399,"depth":592,"text":400},{"id":417,"depth":592,"text":418,"children":596},[597],{"id":431,"depth":598,"text":432},3,{"id":456,"depth":592,"text":457,"children":600},[601],{"id":463,"depth":598,"text":464},{"id":504,"depth":592,"text":504},{"id":551,"depth":592,"text":551},{"id":576,"depth":592,"text":576},"用部署堆疊（Deployment Stack）的角度理解 ECS、Docker 與 Kubernetes 的關係，建立清晰的雲端部署心智模型。","md",null,{"tags":609,"category":203,"date":615},[610,611,612,613,614],"docker","kubernetes","ecs","devops","cloud","2026-02-14",true,{"title":259,"description":605},"WDXR2H1E13m5mCnPy4o73TrzMCocdADW0x6OT1_MhYA",[620,622],{"title":255,"path":256,"stem":257,"description":621,"children":-1},"深入理解 Zeabur 背後的 K3s 與容器架構，掌握從外部使用者請求到 Nuxt Nitro Server 的完整流量路徑。",{"title":263,"path":264,"stem":265,"description":623,"children":-1},"從新手部署網站的情境出發，深入理解 VPS 與 ECS 的本質差異、使用方式與實務選擇建議。",1776690846460]