[{"data":1,"prerenderedAt":267},["ShallowReactive",2],{"term-d\u002Fdocker-compose":3,"related-d\u002Fdocker-compose":249},{"id":4,"title":5,"acronym":6,"body":7,"category":230,"description":231,"difficulty":232,"extension":233,"letter":234,"meta":235,"navigation":151,"path":236,"related":237,"seo":243,"sitemap":244,"stem":247,"subcategory":6,"__hash__":248},"terms\u002Fterms\u002Fd\u002Fdocker-compose.md","Docker Compose",null,{"type":8,"value":9,"toc":224},"minimark",[10,15,28,32,35,39,210,214,220],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18,19,23,24,27],"p",{},"Docker Compose is a tool for running multiple containers together as a team. Your app needs a web server, a database, and a cache? Instead of manually starting 3 containers, you write one ",[20,21,22],"code",{},"docker-compose.yml"," file that describes all three, and one command (",[20,25,26],{},"docker compose up",") starts everything at once.",[11,29,31],{"id":30},"real-talk","Real Talk",[16,33,34],{},"Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It manages the networking, volumes, environment variables, and startup order of multiple services. Widely used for local development environments to mimic production service topologies.",[11,36,38],{"id":37},"show-me-the-code","Show Me The Code",[40,41,46],"pre",{"className":42,"code":43,"language":44,"meta":45,"style":45},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# docker-compose.yml\nservices:\n  app:\n    build: .\n    ports: [\"3000:3000\"]\n    depends_on: [db]\n    environment:\n      DATABASE_URL: postgres:\u002F\u002Fuser:pass@db\u002Fmydb\n\n  db:\n    image: postgres:16\n    volumes:\n      - db-data:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n\nvolumes:\n  db-data:\n","yaml","",[20,47,48,57,68,76,89,112,127,135,146,153,161,172,180,189,194,202],{"__ignoreMap":45},[49,50,53],"span",{"class":51,"line":52},"line",1,[49,54,56],{"class":55},"sHwdD","# docker-compose.yml\n",[49,58,60,64],{"class":51,"line":59},2,[49,61,63],{"class":62},"swJcz","services",[49,65,67],{"class":66},"sMK4o",":\n",[49,69,71,74],{"class":51,"line":70},3,[49,72,73],{"class":62},"  app",[49,75,67],{"class":66},[49,77,79,82,85],{"class":51,"line":78},4,[49,80,81],{"class":62},"    build",[49,83,84],{"class":66},":",[49,86,88],{"class":87},"sbssI"," .\n",[49,90,92,95,97,100,103,107,109],{"class":51,"line":91},5,[49,93,94],{"class":62},"    ports",[49,96,84],{"class":66},[49,98,99],{"class":66}," [",[49,101,102],{"class":66},"\"",[49,104,106],{"class":105},"sfazB","3000:3000",[49,108,102],{"class":66},[49,110,111],{"class":66},"]\n",[49,113,115,118,120,122,125],{"class":51,"line":114},6,[49,116,117],{"class":62},"    depends_on",[49,119,84],{"class":66},[49,121,99],{"class":66},[49,123,124],{"class":105},"db",[49,126,111],{"class":66},[49,128,130,133],{"class":51,"line":129},7,[49,131,132],{"class":62},"    environment",[49,134,67],{"class":66},[49,136,138,141,143],{"class":51,"line":137},8,[49,139,140],{"class":62},"      DATABASE_URL",[49,142,84],{"class":66},[49,144,145],{"class":105}," postgres:\u002F\u002Fuser:pass@db\u002Fmydb\n",[49,147,149],{"class":51,"line":148},9,[49,150,152],{"emptyLinePlaceholder":151},true,"\n",[49,154,156,159],{"class":51,"line":155},10,[49,157,158],{"class":62},"  db",[49,160,67],{"class":66},[49,162,164,167,169],{"class":51,"line":163},11,[49,165,166],{"class":62},"    image",[49,168,84],{"class":66},[49,170,171],{"class":105}," postgres:16\n",[49,173,175,178],{"class":51,"line":174},12,[49,176,177],{"class":62},"    volumes",[49,179,67],{"class":66},[49,181,183,186],{"class":51,"line":182},13,[49,184,185],{"class":66},"      -",[49,187,188],{"class":105}," db-data:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n",[49,190,192],{"class":51,"line":191},14,[49,193,152],{"emptyLinePlaceholder":151},[49,195,197,200],{"class":51,"line":196},15,[49,198,199],{"class":62},"volumes",[49,201,67],{"class":66},[49,203,205,208],{"class":51,"line":204},16,[49,206,207],{"class":62},"  db-data",[49,209,67],{"class":66},[11,211,213],{"id":212},"when-youll-hear-this","When You'll Hear This",[16,215,216,217,219],{},"\"Use Docker Compose to run the full stack locally.\" \u002F \"",[20,218,26],{}," starts the app, database, and Redis all together.\"",[221,222,223],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":45,"searchDepth":59,"depth":59,"links":225},[226,227,228,229],{"id":13,"depth":59,"text":14},{"id":30,"depth":59,"text":31},{"id":37,"depth":59,"text":38},{"id":212,"depth":59,"text":213},"cicd","Docker Compose is a tool for running multiple containers together as a team. Your app needs a web server, a database, and a cache?","beginner","md","d",{},"\u002Fterms\u002Fd\u002Fdocker-compose",[238,239,240,241,242],"Docker","Container","Image","Volume","Kubernetes",{"title":5,"description":231},{"changefreq":245,"priority":246},"weekly",0.7,"terms\u002Fd\u002Fdocker-compose","J1i7DmYQyrebZNohVt64RenazMUjEKXcxnU5OXVmcAI",[250,253,256,259,263],{"title":239,"path":251,"acronym":6,"category":230,"difficulty":232,"description":252},"\u002Fterms\u002Fc\u002Fcontainer","A container is a running instance of a Docker image — it's the lunchbox you made and actually opened to eat from.",{"title":238,"path":254,"acronym":6,"category":230,"difficulty":232,"description":255},"\u002Fterms\u002Fd\u002Fdocker","Docker is like a lunchbox for your app.",{"title":240,"path":257,"acronym":6,"category":230,"difficulty":232,"description":258},"\u002Fterms\u002Fi\u002Fimage","A Docker image is the blueprint or template for a container. It's like a frozen snapshot of your app and everything it needs to run.",{"title":242,"path":260,"acronym":6,"category":230,"difficulty":261,"description":262},"\u002Fterms\u002Fk\u002Fkubernetes","advanced","Kubernetes is a robot manager for your containers.",{"title":241,"path":264,"acronym":6,"category":230,"difficulty":265,"description":266},"\u002Fterms\u002Fv\u002Fvolume","intermediate","A Volume is persistent storage attached to a container — because containers themselves are like tents: when you take them down, everything inside is gone.",1776518274910]