[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"categories-en":3,"post:\u002Fpost\u002Fhow-docker-containers-actually-work-from-code-to-orchestration":37},[4,11,17,24,30],{"id":5,"slug":6,"name":7,"colorHex":8,"iconName":9,"postCount":10},"0e2c1225-f78a-4c20-8c93-998ab9dc93b9","frontend","Frontend","#40484f",null,25,{"id":12,"slug":13,"name":14,"colorHex":15,"iconName":9,"postCount":16},"bc8df70e-b7fb-4d89-a80c-fd458d36d58c","code-development","Code & Development","#8b5cf6",23,{"id":18,"slug":19,"name":20,"colorHex":21,"iconName":22,"postCount":23},"550e8400-e29b-41d4-a716-446655440001","inteligencia-artificial","Artificial Intelligence","#6366f1","brain",14,{"id":25,"slug":26,"name":27,"colorHex":28,"iconName":9,"postCount":29},"ea63b69c-2eb4-4100-81f3-70ce52d33743","tech-news","Tech News","#e50606",4,{"id":31,"slug":32,"name":33,"colorHex":34,"iconName":35,"postCount":36},"550e8400-e29b-41d4-a716-446655440017","how-to-guides","How-To & Guides","#be123c","book-open",2,{"post":38,"related":785,"translations":861,"resolved":9},{"id":39,"slug":40,"title":41,"excerpt":42,"image":43,"featured":44,"groupId":45,"publishedAt":46,"readingTime":47,"views":48,"author":49,"category":51,"tags":52,"contentJson":62,"metaTitle":782,"metaDescription":783,"updatedAt":784},"438e66a7-c972-49d4-8382-1cd6c63ba25e","how-docker-containers-actually-work-from-code-to-orchestration","How Docker Containers Actually Work: From Code to Orchestration","Most developers know how to run docker run. Few understand what happens between docker build and a production app with auto-scaling. This article shows the full path — five stages, each building on the previous one.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1774583827010-featured-pphvhw.jpg",false,"a42f2c02-a62b-46b0-9511-c19b69365a6e","2026-03-27T03:59:56.085+00:00",8,189,{"name":50,"avatar":9},"Genildo Souza",{"slug":13,"name":14,"color":15},[53,56,59],{"slug":54,"name":55},"docker","Docker",{"slug":57,"name":58},"kubernetes","Kubernetes",{"slug":60,"name":61},"cloud","Cloud",{"type":63,"content":64},"doc",[65,86,92,98,117,124,126,133,139,169,178,207,213,214,220,236,253,259,269,285,293,299,300,306,322,328,334,350,365,383,390,405,406,412,418,442,454,461,467,475,493,494,500,506,518,524,534,550,556,566,576,586,596,603,610,624,625,631,637,647,657,666,672,673,679,779],{"type":66,"attrs":67,"content":69},"paragraph",{"id":68},"p_j9jurgmk",[70,73,78,80,84],{"text":71,"type":72},"You know how to run ","text",{"text":74,"type":72,"marks":75},"docker run",[76],{"type":77},"code",{"text":79,"type":72},". Maybe you can write a basic Dockerfile. But if someone stopped you right now and asked — \"what happens between the moment you type ",{"text":81,"type":72,"marks":82},"docker build",[83],{"type":77},{"text":85,"type":72}," and the moment your app is running in production with auto-scaling?\" — could you explain every step?",{"type":66,"attrs":87,"content":89},{"id":88},"p_3jmyubx3",[90],{"text":91,"type":72},"Most developers can't. Not because they lack the ability. Because Docker is taught in disconnected pieces: a Dockerfile tutorial here, a Kubernetes video there, a networking article somewhere else. Nobody shows the entire path at once.",{"type":66,"attrs":93,"content":95},{"id":94},"p_kw3jlg7j",[96],{"text":97,"type":72},"This article does.",{"type":66,"attrs":99,"content":101},{"id":100},"p_284iho57",[102,104,109,111,115],{"text":103,"type":72},"From the Dockerfile to Kubernetes orchestration — five stages, each building on the previous one. By the end, you'll understand not just ",{"text":105,"type":72,"marks":106},"how",[107],{"type":108},"italic",{"text":110,"type":72}," each piece works, but ",{"text":112,"type":72,"marks":113},"why",[114],{"type":108},{"text":116,"type":72}," it exists.",{"type":118,"attrs":119},"image",{"id":120,"alt":9,"src":121,"size":122,"align":123,"title":9,"width":9,"height":9},"img_l4lbwrz7","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002F1774583969970-pwvbjm.png","large","center",{"type":125},"horizontalRule",{"type":127,"attrs":128,"content":130},"heading",{"id":129,"level":36},"h_kvbd73wt",[131],{"text":132,"type":72},"1. The Dockerfile: the recipe",{"type":66,"attrs":134,"content":136},{"id":135},"p_xewke5s7",[137],{"text":138,"type":72},"Everything starts with a text file. No extension, no magic — just instructions telling Docker how to assemble the environment where your code will run.",{"type":66,"attrs":140,"content":142},{"id":141},"p_2dp0itnz",[143,145,149,151,155,157,161,163,167],{"text":144,"type":72},"Think of a Dockerfile as a cooking recipe. ",{"text":146,"type":72,"marks":147},"FROM",[148],{"type":77},{"text":150,"type":72}," picks the base (\"start with a kitchen that already has an oven and a sink\"). ",{"text":152,"type":72,"marks":153},"COPY",[154],{"type":77},{"text":156,"type":72}," brings the ingredients (\"put your code here\"). ",{"text":158,"type":72,"marks":159},"RUN",[160],{"type":77},{"text":162,"type":72}," prepares (\"install dependencies\"). ",{"text":164,"type":72,"marks":165},"CMD",[166],{"type":77},{"text":168,"type":72}," serves (\"when the container starts, execute this\").",{"type":170,"attrs":171,"content":175},"codeBlock",{"id":172,"language":173,"highlighted":174},"code_k647gwd6","dockerfile","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Example: Node.js app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">FROM\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> node:20-alpine\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">WORKDIR\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> \u002Fapp\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">COPY\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> package*.json .\u002F\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">RUN\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> npm ci --only=production\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">COPY\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> . .\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">EXPOSE\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> 3000\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">CMD\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> [\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"node\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"server.js\"\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[176],{"text":177,"type":72},"# Example: Node.js app\nFROM node:20-alpine\n\nWORKDIR \u002Fapp\n\nCOPY package*.json .\u002F\nRUN npm ci --only=production\n\nCOPY . .\n\nEXPOSE 3000\nCMD [\"node\", \"server.js\"]\n",{"type":66,"attrs":179,"content":181},{"id":180},"p_6zsk46a4",[182,187,189,193,195,199,201,205],{"text":183,"type":72,"marks":184},"The order of instructions matters.",[185],{"type":186},"bold",{"text":188,"type":72}," Docker caches each layer. If you put ",{"text":190,"type":72,"marks":191},"COPY . .",[192],{"type":77},{"text":194,"type":72}," before ",{"text":196,"type":72,"marks":197},"RUN npm ci",[198],{"type":77},{"text":200,"type":72},", any change in any project file invalidates the installation cache — and Docker reinstalls everything from scratch. By copying only ",{"text":202,"type":72,"marks":203},"package.json",[204],{"type":77},{"text":206,"type":72}," first, the dependency cache survives as long as dependencies haven't changed.",{"type":66,"attrs":208,"content":210},{"id":209},"p_aq0ztpzo",[211],{"text":212,"type":72},"Each Dockerfile instruction becomes a layer in the final image. Which brings us to the next stage.",{"type":125},{"type":127,"attrs":215,"content":217},{"id":216,"level":36},"h_wuklc4hm",[218],{"text":219,"type":72},"2. Build and Layers: the immutable image",{"type":66,"attrs":221,"content":223},{"id":222},"p_4pe22mjw",[224,226,229,231,234],{"text":225,"type":72},"When you run ",{"text":81,"type":72,"marks":227},[228],{"type":77},{"text":230,"type":72},", Docker reads the Dockerfile and creates an ",{"text":118,"type":72,"marks":232},[233],{"type":186},{"text":235,"type":72}," — a read-only template containing everything your app needs to run: base OS, dependencies, code, configuration.",{"type":66,"attrs":237,"content":239},{"id":238},"p_gmiu5pma",[240,242,246,248,251],{"text":241,"type":72},"The image is built in stacked layers. Each Dockerfile instruction generates one layer. Layer 1 is the base OS — in the example above, Alpine Linux with Node.js 20. Layer 2 is the dependencies installed by ",{"text":243,"type":72,"marks":244},"npm ci",[245],{"type":77},{"text":247,"type":72},". Layer 3 is your app code copied by ",{"text":190,"type":72,"marks":249},[250],{"type":77},{"text":252,"type":72},".",{"type":66,"attrs":254,"content":256},{"id":255},"p_d8978mxj",[257],{"text":258,"type":72},"Two properties make this system work:",{"type":66,"attrs":260,"content":262},{"id":261},"p_5a2flv9p",[263,267],{"text":264,"type":72,"marks":265},"Immutability.",[266],{"type":186},{"text":268,"type":72}," Once created, the image doesn't change. If you need to modify something, you create a new image. This guarantees that what runs in dev is identical to what runs in production — the classic \"works on my machine\" problem disappears.",{"type":66,"attrs":270,"content":272},{"id":271},"p_84tv5aj3",[273,277,279,283],{"text":274,"type":72,"marks":275},"Layer reuse.",[276],{"type":186},{"text":278,"type":72}," If two images share the same base (",{"text":280,"type":72,"marks":281},"node:20-alpine",[282],{"type":77},{"text":284,"type":72},"), Docker stores that layer only once. Ten different apps with the same base don't take 10x the space — they take 1x the base plus each app's delta.",{"type":170,"attrs":286,"content":290},{"id":287,"language":288,"highlighted":289},"code_mcetu00v","bash","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Build the image\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">docker\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> build -t my-app:1.0 .\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">#\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> Inspect the layers\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">docker\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> history my-app:1.0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[291],{"text":292,"type":72},"# Build the image\ndocker build -t my-app:1.0 .\n\n# Inspect the layers\ndocker history my-app:1.0\n",{"type":66,"attrs":294,"content":296},{"id":295},"p_5oez6rtf",[297],{"text":298,"type":72},"The image is the blueprint. To turn it into something that actually runs, you need a container.",{"type":125},{"type":127,"attrs":301,"content":303},{"id":302,"level":36},"h_rp9utzco",[304],{"text":305,"type":72},"3. Container Runtime: where code comes alive",{"type":66,"attrs":307,"content":309},{"id":308},"p_h66ye94i",[310,311,314,316,320],{"text":225,"type":72},{"text":74,"type":72,"marks":312},[313],{"type":77},{"text":315,"type":72},", Docker takes the image (read-only) and creates a live instance of it — the ",{"text":317,"type":72,"marks":318},"container",[319],{"type":186},{"text":321,"type":72},". It's like the difference between a class and an object in programming: the image is the class, the container is the instance.",{"type":66,"attrs":323,"content":325},{"id":324},"p_gsu3z32c",[326],{"text":327,"type":72},"The container gets a writable layer on top of the image's read-only layers. Everything the app writes at runtime — logs, temp files, session data — goes into this layer. When the container is destroyed, this layer is discarded. The data disappears.",{"type":66,"attrs":329,"content":331},{"id":330},"p_5nzfw5f7",[332],{"text":333,"type":72},"But what makes a container different from just running the app directly on the operating system? Two Linux kernel technologies:",{"type":66,"attrs":335,"content":337},{"id":336},"p_iyww2ari",[338,342,344,348],{"text":339,"type":72,"marks":340},"Namespaces",[341],{"type":186},{"text":343,"type":72}," control what the container ",{"text":345,"type":72,"marks":346},"sees",[347],{"type":186},{"text":349,"type":72},". They isolate processes (PID), network (NET), filesystem (MNT), hostname (UTS), users (USER), and inter-process communication (IPC). The container thinks it's the only process in the world.",{"type":66,"attrs":351,"content":353},{"id":352},"p_er17t1a3",[354,358,359,363],{"text":355,"type":72,"marks":356},"Cgroups",[357],{"type":186},{"text":343,"type":72},{"text":360,"type":72,"marks":361},"consumes",[362],{"type":186},{"text":364,"type":72},". They limit CPU, memory, swap, and disk I\u002FO. Without cgroups, a container with a memory leak would take down the entire host.",{"type":66,"attrs":366,"content":368},{"id":367},"p_3e0dtzb2",[369,371,375,377,381],{"text":370,"type":72},"Under the hood, the heavy lifting is done by ",{"text":372,"type":72,"marks":373},"containerd",[374],{"type":77},{"text":376,"type":72}," (the runtime daemon) together with ",{"text":378,"type":72,"marks":379},"runc",[380],{"type":77},{"text":382,"type":72}," (which creates the container using kernel APIs). The Docker CLI is an interface — the real work happens in these two.",{"type":170,"attrs":384,"content":387},{"id":385,"language":288,"highlighted":386},"code_u6az5xvd","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># Run the container\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">docker\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> run -d --name my-app -p 3000:3000 my-app:1.0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">#\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> See running containers\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">docker\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ps\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">#\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> Monitor resource consumption\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">docker\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> stats my-app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[388],{"text":389,"type":72},"# Run the container\ndocker run -d --name my-app -p 3000:3000 my-app:1.0\n\n# See running containers\ndocker ps\n\n# Monitor resource consumption\ndocker stats my-app\n",{"type":391,"attrs":392,"content":394},"blockquote",{"id":393},"quote_0twyrwgc",[395],{"type":66,"attrs":396,"content":398},{"id":397},"p_rvgpwqm5",[399,403],{"text":400,"type":72,"marks":401},"Container ≠ VM.",[402],{"type":186},{"text":404,"type":72}," A virtual machine runs a complete operating system with its own kernel. A container shares the host's kernel and uses namespaces and cgroups to simulate isolation. That's why containers start in milliseconds and consume a fraction of a VM's resources.",{"type":125},{"type":127,"attrs":407,"content":409},{"id":408,"level":36},"h_fx316t4r",[410],{"text":411,"type":72},"4. Networking: how containers talk",{"type":66,"attrs":413,"content":415},{"id":414},"p_ea363wgf",[416],{"text":417,"type":72},"An isolated container isn't very useful. Your app needs to receive requests from the outside world. Your app needs to talk to the database. And the database is... another container.",{"type":66,"attrs":419,"content":421},{"id":420},"p_z0444g56",[422,424,428,430,434,436,440],{"text":423,"type":72},"Docker solves this with a ",{"text":425,"type":72,"marks":426},"bridge network",[427],{"type":186},{"text":429,"type":72}," — an internal virtual network (",{"text":431,"type":72,"marks":432},"docker0",[433],{"type":77},{"text":435,"type":72},") that connects containers to each other. Containers on the same bridge network can communicate directly by name. The app container calls the database at ",{"text":437,"type":72,"marks":438},"db:5432",[439],{"type":77},{"text":441,"type":72}," instead of an IP address. Docker handles DNS resolution.",{"type":66,"attrs":443,"content":445},{"id":444},"p_vm9qy1og",[446,448,452],{"text":447,"type":72},"For the outside world to reach a container, you use ",{"text":449,"type":72,"marks":450},"port mapping",[451],{"type":186},{"text":453,"type":72},": map a host port to a container port.",{"type":170,"attrs":455,"content":458},{"id":456,"language":288,"highlighted":457},"code_fz8hz6l4","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># -p hostPort:containerPort\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">docker\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> run -d -p 80:3000 my-app:1.0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">#\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> Now: http:\u002F\u002Flocalhost:80 → container:3000\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[459],{"text":460,"type":72},"# -p hostPort:containerPort\ndocker run -d -p 80:3000 my-app:1.0\n# Now: http:\u002F\u002Flocalhost:80 → container:3000\n",{"type":66,"attrs":462,"content":464},{"id":463},"p_b51omv2q",[465],{"text":466,"type":72},"With Docker Compose, networking is created automatically:",{"type":170,"attrs":468,"content":472},{"id":469,"language":470,"highlighted":471},"code_2t277ezj","yaml","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># docker-compose.yml\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">s\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">ervices\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  app\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    build\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    ports\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">      - \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"80:3000\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    depends_on\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">      - \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">db\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  db\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    image\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">postgres:16-alpine\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    environment\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">      POSTGRES_PASSWORD\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">secret\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    volumes\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">      - \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">pgdata:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">volumes\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  pgdata\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[473],{"text":474,"type":72},"# docker-compose.yml\nservices:\n  app:\n    build: .\n    ports:\n      - \"80:3000\"\n    depends_on:\n      - db\n\n  db:\n    image: postgres:16-alpine\n    environment:\n      POSTGRES_PASSWORD: secret\n    volumes:\n      - pgdata:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n\nvolumes:\n  pgdata:\n",{"type":66,"attrs":476,"content":478},{"id":477},"p_ctxhzx2w",[479,483,487,491],{"text":480,"type":72,"marks":481},"The ",[482],{"type":186},{"text":484,"type":72,"marks":485},"pgdata",[486],{"type":77},{"text":488,"type":72,"marks":489}," volume is critical.",[490],{"type":186},{"text":492,"type":72}," Remember that the container's writable layer is discarded when it dies? Without the volume, your Postgres data dies with it. Volumes live outside the container — they persist across restarts, upgrades, and recreations.",{"type":125},{"type":127,"attrs":495,"content":497},{"id":496,"level":36},"h_kppjv1u1",[498],{"text":499,"type":72},"5. Orchestration with Kubernetes: when one container isn't enough",{"type":66,"attrs":501,"content":503},{"id":502},"p_6y0wgofq",[504],{"text":505,"type":72},"Docker Compose works well for local development and simple projects. But in real production — with thousands of requests, high availability requirements, zero-downtime deploys — you need something more.",{"type":66,"attrs":507,"content":509},{"id":508},"p_emmelo2j",[510,512,516],{"text":511,"type":72},"That's where Kubernetes (K8s) comes in. If Docker is what creates and runs containers, Kubernetes is what ",{"text":513,"type":72,"marks":514},"manages",[515],{"type":186},{"text":517,"type":72}," containers at scale.",{"type":66,"attrs":519,"content":521},{"id":520},"p_xga8njpc",[522],{"text":523,"type":72},"The K8s architecture has two levels:",{"type":66,"attrs":525,"content":527},{"id":526},"p_47uxlbyk",[528,532],{"text":529,"type":72,"marks":530},"Control Plane (Master Node)",[531],{"type":186},{"text":533,"type":72}," — the brain. Contains the API Server (receives commands), the Scheduler (decides where to run each container), the Controller Manager (ensures actual state matches desired state), and etcd (the cluster's database).",{"type":66,"attrs":535,"content":537},{"id":536},"p_c9kn70j8",[538,542,544,548],{"text":539,"type":72,"marks":540},"Worker Nodes",[541],{"type":186},{"text":543,"type":72}," — the hands. Each node is a machine (physical or virtual) that runs containers. Containers live inside ",{"text":545,"type":72,"marks":546},"Pods",[547],{"type":186},{"text":549,"type":72}," — the smallest unit in Kubernetes. A Pod usually contains one container, though it can contain more when they need to share resources.",{"type":66,"attrs":551,"content":553},{"id":552},"p_u0scrvz4",[554],{"text":555,"type":72},"What Kubernetes does that Docker Compose doesn't:",{"type":66,"attrs":557,"content":559},{"id":558},"p_kguflmd1",[560,564],{"text":561,"type":72,"marks":562},"Scaling",[563],{"type":186},{"text":565,"type":72}," — auto-scales Pods based on CPU, memory, or custom metrics. Traffic spiked? More Pods. Traffic dropped? Fewer Pods.",{"type":66,"attrs":567,"content":569},{"id":568},"p_jyns7xwr",[570,574],{"text":571,"type":72,"marks":572},"Self-healing",[573],{"type":186},{"text":575,"type":72}," — if a Pod dies, K8s restarts it automatically. If an entire node goes down, Pods are rescheduled to other nodes.",{"type":66,"attrs":577,"content":579},{"id":578},"p_9izy77xp",[580,584],{"text":581,"type":72,"marks":582},"Rollouts",[583],{"type":186},{"text":585,"type":72}," — gradual deployment — updates Pods one by one, checking health at each step. If something breaks, automatic rollback.",{"type":66,"attrs":587,"content":589},{"id":588},"p_c3aors53",[590,594],{"text":591,"type":72,"marks":592},"Service Discovery",[593],{"type":186},{"text":595,"type":72}," — internal DNS and Services. Pods find other Pods by name, with automatic load balancing across replicas.",{"type":170,"attrs":597,"content":600},{"id":598,"language":470,"highlighted":599},"code_3fnkmj1y","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># deployment.yaml\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">a\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">piVersion\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">apps\u002Fv1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">kind\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">Deployment\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">metadata\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  name\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">spec\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  replicas\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">3\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  selector\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    matchLabels\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">      app\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  template\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    metadata\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">      labels\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">        app\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    spec\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">      containers\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">      - \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">name\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">        image\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app:1.0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">        ports\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">        - \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">containerPort\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">3000\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">        resources\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">          limits\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">            memory\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"256Mi\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">            cpu\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"500m\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">          requests\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">            memory\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"128Mi\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">            cpu\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"250m\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[601],{"text":602,"type":72},"# deployment.yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: my-app\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: my-app\n  template:\n    metadata:\n      labels:\n        app: my-app\n    spec:\n      containers:\n      - name: my-app\n        image: my-app:1.0\n        ports:\n        - containerPort: 3000\n        resources:\n          limits:\n            memory: \"256Mi\"\n            cpu: \"500m\"\n          requests:\n            memory: \"128Mi\"\n            cpu: \"250m\"\n",{"type":170,"attrs":604,"content":607},{"id":605,"language":470,"highlighted":606},"code_qlwzr7yb","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\"># service.yaml\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">a\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">piVersion\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">v1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">kind\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">Service\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">metadata\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  name\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app-service\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">spec\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  type\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">LoadBalancer\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  selector\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    app\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">my-app\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">  ports\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">  - \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">port\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">80\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#22863A;--shiki-dark:#85E89D\">    targetPort\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">3000\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",[608],{"text":609,"type":72},"# service.yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: my-app-service\nspec:\n  type: LoadBalancer\n  selector:\n    app: my-app\n  ports:\n  - port: 80\n    targetPort: 3000\n",{"type":391,"attrs":611,"content":613},{"id":612},"quote_l7irnc87",[614],{"type":66,"attrs":615,"content":617},{"id":616},"p_0nkqkv2w",[618,622],{"text":619,"type":72,"marks":620},"Kubernetes is declarative.",[621],{"type":186},{"text":623,"type":72}," You don't say \"start 3 containers.\" You say \"I want 3 replicas running.\" K8s takes care of reaching that state — and maintaining it. If a replica dies, it creates another. You declare the destination; K8s handles the journey.",{"type":125},{"type":127,"attrs":626,"content":628},{"id":627,"level":36},"h_5tqdq2px",[629],{"text":630,"type":72},"When to use what",{"type":66,"attrs":632,"content":634},{"id":633},"p_piooy5oc",[635],{"text":636,"type":72},"Not every project needs Kubernetes. This is a distinction many Docker articles ignore.",{"type":66,"attrs":638,"content":640},{"id":639},"p_990iosby",[641,645],{"text":642,"type":72,"marks":643},"Docker only (no Compose)",[644],{"type":186},{"text":646,"type":72}," — when you have a single container. A script, a CLI tool, an isolated service.",{"type":66,"attrs":648,"content":650},{"id":649},"p_krr11ew1",[651,655],{"text":652,"type":72,"marks":653},"Docker Compose",[654],{"type":186},{"text":656,"type":72}," — when you have multiple containers that need to talk (app + database + cache). Ideal for local dev and small team projects.",{"type":66,"attrs":658,"content":660},{"id":659},"p_4zf7qiz9",[661,664],{"text":58,"type":72,"marks":662},[663],{"type":186},{"text":665,"type":72}," — when you need auto-scaling, self-healing, zero-downtime rollouts, and you're running in production with real traffic. K8s adds significant complexity — only use it when the scale justifies it.",{"type":66,"attrs":667,"content":669},{"id":668},"p_yrwqi980",[670],{"text":671,"type":72},"If you're starting with Docker, don't jump to Kubernetes. Master the Dockerfile, understand layers, practice Compose. Kubernetes is layer 5 — and it only makes sense when layers 1 through 4 are solid.",{"type":125},{"type":127,"attrs":674,"content":676},{"id":675,"level":36},"h_ikep6xcn",[677],{"text":678,"type":72},"The full path in six sentences",{"type":680,"attrs":681,"content":685},"orderedList",{"id":682,"type":9,"start":683,"tight":684},"ol_bwy1spwj",1,true,[686,701,726,740,754,767],{"type":687,"attrs":688,"content":690},"listItem",{"id":689},"li_4p6cm1n3",[691],{"type":66,"attrs":692,"content":694},{"id":693},"p_pe22rd61",[695,699],{"text":696,"type":72,"marks":697},"Dockerfile",[698],{"type":186},{"text":700,"type":72}," — the recipe. Defines the environment, copies code, installs dependencies, declares the startup command. Instruction order affects caching.",{"type":687,"attrs":702,"content":704},{"id":703},"li_40gnhon8",[705],{"type":66,"attrs":706,"content":708},{"id":707},"p_rdbneyw3",[709,713,715,718,720,724],{"text":710,"type":72,"marks":711},"Image",[712],{"type":186},{"text":714,"type":72}," — the immutable template. Built in stacked layers, read-only, reusable. ",{"text":81,"type":72,"marks":716},[717],{"type":77},{"text":719,"type":72}," creates it, ",{"text":721,"type":72,"marks":722},"docker history",[723],{"type":77},{"text":725,"type":72}," inspects it.",{"type":687,"attrs":727,"content":729},{"id":728},"li_aez0d8ge",[730],{"type":66,"attrs":731,"content":733},{"id":732},"p_7c108n24",[734,738],{"text":735,"type":72,"marks":736},"Container",[737],{"type":186},{"text":739,"type":72}," — the live instance. Image + writable layer. Namespaces isolate what it sees. Cgroups limit what it consumes.",{"type":687,"attrs":741,"content":743},{"id":742},"li_5czhwsyc",[744],{"type":66,"attrs":745,"content":747},{"id":746},"p_4vvjmdc5",[748,752],{"text":749,"type":72,"marks":750},"Networking",[751],{"type":186},{"text":753,"type":72}," — bridge network connects containers internally. Port mapping exposes them externally. Volumes persist data across restarts.",{"type":687,"attrs":755,"content":757},{"id":756},"li_hstbde4a",[758],{"type":66,"attrs":759,"content":761},{"id":760},"p_n1lljgg7",[762,765],{"text":58,"type":72,"marks":763},[764],{"type":186},{"text":766,"type":72}," — orchestration at scale. Auto-scaling, self-healing, rollouts, service discovery. Declarative: you define the desired state, K8s maintains it.",{"type":687,"attrs":768,"content":770},{"id":769},"li_9x7xhpyw",[771],{"type":66,"attrs":772,"content":774},{"id":773},"p_1c50a340",[775],{"text":776,"type":72,"marks":777},"Docker Compose for dev and small projects. Kubernetes for production at scale. Don't skip steps.",[778],{"type":186},{"type":66,"attrs":780},{"id":781},"p_b2dedxmt","How Docker Containers Work: From Code to Orchestration","Learn how Docker containers actually work — from writing a Dockerfile and building images to networking, volumes, and Kubernetes orchestration.","2026-08-24T14:53:53.315534+00:00",[786,811,831,845],{"id":787,"slug":788,"title":789,"excerpt":790,"image":791,"featured":684,"groupId":792,"publishedAt":793,"readingTime":794,"views":795,"author":796,"category":797,"tags":798},"81f24e9a-fc6b-47d0-beb9-d00a6137ed99","framework-vs-sdk-who-calls-whom","Framework vs SDK: Who Calls Whom","Most developers memorize names, but few understand the mechanism. Here is the simple rule to tell a framework from an SDK and level up your debugging.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1787491947099-featured-ikba2e.jpg","0ccb21eb-6459-40ed-8110-227836e9bb74","2026-08-23T13:15:25.439194+00:00",10,0,{"name":50,"avatar":9},{"slug":13,"name":14,"color":15},[799,802,805,808],{"slug":800,"name":801},"javascript","JavaScript",{"slug":803,"name":804},"python","Python",{"slug":806,"name":807},"runtime","Runtime",{"slug":809,"name":810},"sdk","Sdk",{"id":812,"slug":813,"title":814,"excerpt":815,"image":816,"featured":44,"groupId":817,"publishedAt":818,"readingTime":819,"views":820,"author":821,"category":822,"tags":823},"c2d6b1ca-29bf-401f-8ab9-a1f828504d0b","microfrontends-with-angular-and-nx-what-nobody-tells-you","Microfrontends with Angular and Nx: what nobody tells you","Every tutorial teaches how to set up microfrontends in minutes, but few reveal the architectural chaos that emerges after months of production deploys.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1785206853570-featured-zoyhgn.webp","3368e1b2-b6de-4e94-a3d4-294fae8ade13","2026-08-03T01:42:48.969355+00:00",15,5,{"name":50,"avatar":9},{"slug":13,"name":14,"color":15},[824,827,828],{"slug":825,"name":826},"angular","Angular",{"slug":800,"name":801},{"slug":829,"name":830},"typescript","TypeScript",{"id":832,"slug":833,"title":834,"excerpt":835,"image":836,"featured":44,"groupId":837,"publishedAt":838,"readingTime":839,"views":794,"author":840,"category":841,"tags":842},"36440333-311c-4081-92e6-030a04a38fed","astro-island-architecture-performance-and-where-the-framework-truly-fits","Astro: Island Architecture, Performance, and Where the Framework Truly Fits","Astro challenges the modern web status quo by prioritizing static HTML and isolating interactivity into independent, lightweight code islands.","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1785721161920-featured-a5vzkb.webp","cb62459e-7ace-43d3-a545-661c5695e925","2026-08-03T01:00:45.280114+00:00",38,{"name":50,"avatar":9},{"slug":13,"name":14,"color":15},[843,844],{"slug":800,"name":801},{"slug":829,"name":830},{"id":846,"slug":847,"title":848,"excerpt":849,"image":850,"featured":44,"groupId":851,"publishedAt":852,"readingTime":853,"views":795,"author":854,"category":855,"tags":856},"633b6488-2a90-4632-86a5-9cff7ed52f08","javascript-event-loop-the-heart-of-non-blocking-concurrency-revisited-in-2025","JavaScript Event Loop: The Heart of Non-Blocking Concurrency — Revisited in 2025","The Event Loop is not just a simple loop, but a sophisticated coordination mechanism between Call Stack, queues, and runtime. Essential for JS concurrency, it enables thousands of asynchronous operations without blocking the UI. This guide explores its structure, differences between Node.js and browsers, common bugs, advanced techniques, and 2025 trends like Structured Concurrency and scheduler.yield().","https:\u002F\u002Fmfgiomkkbihnlpfdxwrt.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fblog-assets\u002Fmedia\u002Ffeatured\u002F1772847201637-featured-oreiro.jpeg","df6ca967-8130-4b2d-bcac-3532a150131e","2026-07-26T18:54:25.359533+00:00",6,{"name":50,"avatar":9},{"slug":13,"name":14,"color":15},[857,858],{"slug":800,"name":801},{"slug":859,"name":860},"nodejs","Node.js",{"en":40,"pt":862},"docker-do-codigo-a-orquestracao-o-guia-que-explica-o-caminho-inteiro"]