[{"data":1,"prerenderedAt":2026},["ShallowReactive",2],{"authors":3,"article-2022-06-10-how-to-use-vscode-debugger-with-multiple-docker-services":331},[4,23,35,48,61,73,85,98,111,124,136,148,161,173,185,197,209,221,233,245,258,270,282,295,307,319],{"id":5,"title":6,"body":7,"description":11,"extension":14,"meta":15,"name":16,"navigation":17,"path":18,"readingTime":19,"seo":20,"stem":21,"__hash__":22},"authors\u002Fauthors\u002Falexandre-guillon.md","Software Engineer",{"type":8,"value":9,"toc":10},"minimark",[],{"title":11,"searchDepth":12,"depth":12,"links":13},"",2,[],"md",{},"Alexandre Guillon",true,"\u002Fauthors\u002Falexandre-guillon",1,{"title":6,"description":11},"authors\u002Falexandre-guillon","4tf48mjyjFNqItOHaulICbrjeCyMag1o6801uHeTz98",{"id":24,"title":6,"body":25,"description":11,"extension":14,"meta":29,"name":30,"navigation":17,"path":31,"readingTime":19,"seo":32,"stem":33,"__hash__":34},"authors\u002Fauthors\u002Falexis-ablain.md",{"type":8,"value":26,"toc":27},[],{"title":11,"searchDepth":12,"depth":12,"links":28},[],{},"Alexis Ablain","\u002Fauthors\u002Falexis-ablain",{"title":6,"description":11},"authors\u002Falexis-ablain","_SIAtB7f-39e5t3GiJof81NP47s6MGo2n4gaHkTy1uQ",{"id":36,"title":37,"body":38,"description":11,"extension":14,"meta":42,"name":43,"navigation":17,"path":44,"readingTime":19,"seo":45,"stem":46,"__hash__":47},"authors\u002Fauthors\u002Faxel-shaita.md","Engineering Manager",{"type":8,"value":39,"toc":40},[],{"title":11,"searchDepth":12,"depth":12,"links":41},[],{},"Axel Shaïta","\u002Fauthors\u002Faxel-shaita",{"title":37,"description":11},"authors\u002Faxel-shaita","fK0argUhsBkWLjpTAhY13oYLVzQthcEYkCEdtHWmIgE",{"id":49,"title":50,"body":51,"description":11,"extension":14,"meta":55,"name":56,"navigation":17,"path":57,"readingTime":19,"seo":58,"stem":59,"__hash__":60},"authors\u002Fauthors\u002Fbaptiste-faure.md","Head of Talent Acquisition",{"type":8,"value":52,"toc":53},[],{"title":11,"searchDepth":12,"depth":12,"links":54},[],{},"Baptiste Faure","\u002Fauthors\u002Fbaptiste-faure",{"title":50,"description":11},"authors\u002Fbaptiste-faure","ELisToYtcgHmgdVWZkCclTPV6exZtfyXqhpx1jjbJHs",{"id":62,"title":6,"body":63,"description":11,"extension":14,"meta":67,"name":68,"navigation":17,"path":69,"readingTime":19,"seo":70,"stem":71,"__hash__":72},"authors\u002Fauthors\u002Fbenjamin-bouillot.md",{"type":8,"value":64,"toc":65},[],{"title":11,"searchDepth":12,"depth":12,"links":66},[],{},"Benjamin Bouillot","\u002Fauthors\u002Fbenjamin-bouillot",{"title":6,"description":11},"authors\u002Fbenjamin-bouillot","tbhCFZyfTt7ZM5b5YgqQ2nhgnSTl8BweaQQryc87fHo",{"id":74,"title":37,"body":75,"description":11,"extension":14,"meta":79,"name":80,"navigation":17,"path":81,"readingTime":19,"seo":82,"stem":83,"__hash__":84},"authors\u002Fauthors\u002Fcedric-nicoloso.md",{"type":8,"value":76,"toc":77},[],{"title":11,"searchDepth":12,"depth":12,"links":78},[],{},"Cédric Nicoloso","\u002Fauthors\u002Fcedric-nicoloso",{"title":37,"description":11},"authors\u002Fcedric-nicoloso","ibSoh4VZYiWYTuLOnZTedaAfcnvet1Q9H7ogW0LgorY",{"id":86,"title":87,"body":88,"description":11,"extension":14,"meta":92,"name":93,"navigation":17,"path":94,"readingTime":19,"seo":95,"stem":96,"__hash__":97},"authors\u002Fauthors\u002Fdavid-touzet.md","Staff Engineer",{"type":8,"value":89,"toc":90},[],{"title":11,"searchDepth":12,"depth":12,"links":91},[],{},"David Touzet","\u002Fauthors\u002Fdavid-touzet",{"title":87,"description":11},"authors\u002Fdavid-touzet","dHWwnQxb1Ubt-WwXWEODGEo9AFoq1cJUhfg3kdnYSBM",{"id":99,"title":100,"body":101,"description":11,"extension":14,"meta":105,"name":106,"navigation":17,"path":107,"readingTime":19,"seo":108,"stem":109,"__hash__":110},"authors\u002Fauthors\u002Feloise-chizat.md","Data Engineer",{"type":8,"value":102,"toc":103},[],{"title":11,"searchDepth":12,"depth":12,"links":104},[],{},"Eloïse Chizat","\u002Fauthors\u002Feloise-chizat",{"title":100,"description":11},"authors\u002Feloise-chizat","Utd72Vm9qT4hh2ZbFi6a2_nXw5Wb494Ed_HL1ra5yw8",{"id":112,"title":113,"body":114,"description":11,"extension":14,"meta":118,"name":119,"navigation":17,"path":120,"readingTime":19,"seo":121,"stem":122,"__hash__":123},"authors\u002Fauthors\u002Femmanuel-auclair.md","Staff engineer",{"type":8,"value":115,"toc":116},[],{"title":11,"searchDepth":12,"depth":12,"links":117},[],{},"Emmanuel Auclair","\u002Fauthors\u002Femmanuel-auclair",{"title":113,"description":11},"authors\u002Femmanuel-auclair","MtsA8THNLEn0dTtYEIQaGwDuf7MjQL55IOeei5gugEg",{"id":125,"title":6,"body":126,"description":11,"extension":14,"meta":130,"name":131,"navigation":17,"path":132,"readingTime":19,"seo":133,"stem":134,"__hash__":135},"authors\u002Fauthors\u002Fhoreb-parraud.md",{"type":8,"value":127,"toc":128},[],{"title":11,"searchDepth":12,"depth":12,"links":129},[],{},"Horeb Parraud","\u002Fauthors\u002Fhoreb-parraud",{"title":6,"description":11},"authors\u002Fhoreb-parraud","ajjsnUX4ohZI-ghMdbb92q_taWDkKXVZSLZXoAeLQtg",{"id":137,"title":37,"body":138,"description":11,"extension":14,"meta":142,"name":143,"navigation":17,"path":144,"readingTime":19,"seo":145,"stem":146,"__hash__":147},"authors\u002Fauthors\u002Fhugo-contreras.md",{"type":8,"value":139,"toc":140},[],{"title":11,"searchDepth":12,"depth":12,"links":141},[],{},"Hugo Contreras","\u002Fauthors\u002Fhugo-contreras",{"title":37,"description":11},"authors\u002Fhugo-contreras","2nc3VMu9ASq9Z6Pwx2-7-Ye991Pww4p-UEDBQFfjF-Q",{"id":149,"title":150,"body":151,"description":11,"extension":14,"meta":155,"name":156,"navigation":17,"path":157,"readingTime":19,"seo":158,"stem":159,"__hash__":160},"authors\u002Fauthors\u002Fjulien-tassin.md","Head of Engineering",{"type":8,"value":152,"toc":153},[],{"title":11,"searchDepth":12,"depth":12,"links":154},[],{},"Julien Tassin","\u002Fauthors\u002Fjulien-tassin",{"title":150,"description":11},"authors\u002Fjulien-tassin","iUIHI7SITje38Jh9X9uvYs4-VsHx4eCdt6hAlyLFG_o",{"id":162,"title":6,"body":163,"description":11,"extension":14,"meta":167,"name":168,"navigation":17,"path":169,"readingTime":19,"seo":170,"stem":171,"__hash__":172},"authors\u002Fauthors\u002Flaurent-renard.md",{"type":8,"value":164,"toc":165},[],{"title":11,"searchDepth":12,"depth":12,"links":166},[],{},"Laurent Renard","\u002Fauthors\u002Flaurent-renard",{"title":6,"description":11},"authors\u002Flaurent-renard","5BP7Ed-pt1SQHjh0UJ1XUrlLTcdlFaDoKBCP4deHq8A",{"id":174,"title":6,"body":175,"description":11,"extension":14,"meta":179,"name":180,"navigation":17,"path":181,"readingTime":19,"seo":182,"stem":183,"__hash__":184},"authors\u002Fauthors\u002Fleo-martin.md",{"type":8,"value":176,"toc":177},[],{"title":11,"searchDepth":12,"depth":12,"links":178},[],{},"Léo Martin","\u002Fauthors\u002Fleo-martin",{"title":6,"description":11},"authors\u002Fleo-martin","eYxCHkRgbGDV7shKdTA9s7Tu0zGV4yDGFoKR5MHQntY",{"id":186,"title":6,"body":187,"description":11,"extension":14,"meta":191,"name":192,"navigation":17,"path":193,"readingTime":19,"seo":194,"stem":195,"__hash__":196},"authors\u002Fauthors\u002Floic-bousquet.md",{"type":8,"value":188,"toc":189},[],{"title":11,"searchDepth":12,"depth":12,"links":190},[],{},"Loïc Bousquet","\u002Fauthors\u002Floic-bousquet",{"title":6,"description":11},"authors\u002Floic-bousquet","ko12qZwiGL8XNjAoy9oWypPkIjr29Pbq7vhdtgldqeQ",{"id":198,"title":6,"body":199,"description":11,"extension":14,"meta":203,"name":204,"navigation":17,"path":205,"readingTime":19,"seo":206,"stem":207,"__hash__":208},"authors\u002Fauthors\u002Floic-poullain.md",{"type":8,"value":200,"toc":201},[],{"title":11,"searchDepth":12,"depth":12,"links":202},[],{},"Loïc Poullain","\u002Fauthors\u002Floic-poullain",{"title":6,"description":11},"authors\u002Floic-poullain","oRIyJhFRTqxy5dLCYQ2OnYZ1DB-gLDUM-85vTSYuTF0",{"id":210,"title":100,"body":211,"description":11,"extension":14,"meta":215,"name":216,"navigation":17,"path":217,"readingTime":19,"seo":218,"stem":219,"__hash__":220},"authors\u002Fauthors\u002Fmaud-lelu.md",{"type":8,"value":212,"toc":213},[],{"title":11,"searchDepth":12,"depth":12,"links":214},[],{},"Maud Lélu","\u002Fauthors\u002Fmaud-lelu",{"title":100,"description":11},"authors\u002Fmaud-lelu","MMbsCKuE41OMHusrl12FIEsI-Trx7l8Nn_ANhvj2_y4",{"id":222,"title":37,"body":223,"description":11,"extension":14,"meta":227,"name":228,"navigation":17,"path":229,"readingTime":19,"seo":230,"stem":231,"__hash__":232},"authors\u002Fauthors\u002Fnicolas-poirier.md",{"type":8,"value":224,"toc":225},[],{"title":11,"searchDepth":12,"depth":12,"links":226},[],{},"Nicolas Poirier","\u002Fauthors\u002Fnicolas-poirier",{"title":37,"description":11},"authors\u002Fnicolas-poirier","dXrJkYo8az4SN_D23aYc3fQ7z8s1dR2a0lt1ogjAjJs",{"id":234,"title":37,"body":235,"description":11,"extension":14,"meta":239,"name":240,"navigation":17,"path":241,"readingTime":19,"seo":242,"stem":243,"__hash__":244},"authors\u002Fauthors\u002Fraphael-sauget.md",{"type":8,"value":236,"toc":237},[],{"title":11,"searchDepth":12,"depth":12,"links":238},[],{},"Raphaël Sauget","\u002Fauthors\u002Fraphael-sauget",{"title":37,"description":11},"authors\u002Fraphael-sauget","Uri9bcq0QDuxRA0PbBoNtu7p_5L3dALu4kzcXVW0xyM",{"id":246,"title":247,"body":248,"description":11,"extension":14,"meta":252,"name":253,"navigation":17,"path":254,"readingTime":19,"seo":255,"stem":256,"__hash__":257},"authors\u002Fauthors\u002Fromain-koenig.md","Co-funder & Head of innovation",{"type":8,"value":249,"toc":250},[],{"title":11,"searchDepth":12,"depth":12,"links":251},[],{},"Romain Koenig","\u002Fauthors\u002Fromain-koenig",{"title":247,"description":11},"authors\u002Fromain-koenig","uyS8--eG2_ezyqRABcJnMJmQKKuSArhPWd14aUvFeEw",{"id":259,"title":37,"body":260,"description":11,"extension":14,"meta":264,"name":265,"navigation":17,"path":266,"readingTime":19,"seo":267,"stem":268,"__hash__":269},"authors\u002Fauthors\u002Fromaric-juniet.md",{"type":8,"value":261,"toc":262},[],{"title":11,"searchDepth":12,"depth":12,"links":263},[],{},"Romaric Juniet","\u002Fauthors\u002Fromaric-juniet",{"title":37,"description":11},"authors\u002Fromaric-juniet","4Zb2artgT-eo-PHLXi3xi4d5t7s6PfhUxeSfXIikSUY",{"id":271,"title":6,"body":272,"description":11,"extension":14,"meta":276,"name":277,"navigation":17,"path":278,"readingTime":19,"seo":279,"stem":280,"__hash__":281},"authors\u002Fauthors\u002Fstanyslas-bres.md",{"type":8,"value":273,"toc":274},[],{"title":11,"searchDepth":12,"depth":12,"links":275},[],{},"Stanyslas Bres","\u002Fauthors\u002Fstanyslas-bres",{"title":6,"description":11},"authors\u002Fstanyslas-bres","Xa0SahETuiN4q1jrmR2ych3moAqcZ2LbU7vSfEt2RuU",{"id":283,"title":284,"body":285,"description":11,"extension":14,"meta":289,"name":290,"navigation":17,"path":291,"readingTime":19,"seo":292,"stem":293,"__hash__":294},"authors\u002Fauthors\u002Ftalent-acquisition.md","Talent Acquisition",{"type":8,"value":286,"toc":287},[],{"title":11,"searchDepth":12,"depth":12,"links":288},[],{},"Équipe Talent Acquisition","\u002Fauthors\u002Ftalent-acquisition",{"description":11},"authors\u002Ftalent-acquisition","doDfE76txftQ4wIiKjJoDmSpyzSKk0tzlgVAp6-opAY",{"id":296,"title":6,"body":297,"description":11,"extension":14,"meta":301,"name":302,"navigation":17,"path":303,"readingTime":19,"seo":304,"stem":305,"__hash__":306},"authors\u002Fauthors\u002Fvictor-borg.md",{"type":8,"value":298,"toc":299},[],{"title":11,"searchDepth":12,"depth":12,"links":300},[],{},"Victor Borg","\u002Fauthors\u002Fvictor-borg",{"title":6,"description":11},"authors\u002Fvictor-borg","-Za-JweoiP6hyclue_WkxMXdRUDTczPGlJf6AZckjUc",{"id":308,"title":6,"body":309,"description":11,"extension":14,"meta":313,"name":314,"navigation":17,"path":315,"readingTime":19,"seo":316,"stem":317,"__hash__":318},"authors\u002Fauthors\u002Fvirgil-roger.md",{"type":8,"value":310,"toc":311},[],{"title":11,"searchDepth":12,"depth":12,"links":312},[],{},"Virgil Roger","\u002Fauthors\u002Fvirgil-roger",{"title":6,"description":11},"authors\u002Fvirgil-roger","DfVFe5j0bCgXeEr381ZYOM5DP4m-pWb93J9-m_muKJ0",{"id":320,"title":6,"body":321,"description":11,"extension":14,"meta":325,"name":326,"navigation":17,"path":327,"readingTime":19,"seo":328,"stem":329,"__hash__":330},"authors\u002Fauthors\u002Fyukan-zhao.md",{"type":8,"value":322,"toc":323},[],{"title":11,"searchDepth":12,"depth":12,"links":324},[],{},"Yukan Zhao","\u002Fauthors\u002Fyukan-zhao",{"title":6,"description":11},"authors\u002Fyukan-zhao","LRPHugtAJnWHsmHxy9_SR5Zas_C5p-GR_uHEs1Fhk_E",{"id":332,"title":333,"author":334,"body":335,"date":2016,"description":2017,"extension":14,"lang":2018,"meta":2019,"navigation":17,"path":2020,"published":17,"readingTime":449,"seo":2021,"stem":2022,"tags":2023,"__hash__":2025},"articles\u002Farticles\u002F2022-06-10-how-to-use-vscode-debugger-with-multiple-docker-services.md","How to use VSCode debugger with multiple Docker services","loic-poullain",{"type":8,"value":336,"toc":2000},[337,341,344,359,364,371,376,381,470,475,654,659,749,754,762,766,776,780,828,831,856,873,877,881,888,910,914,986,989,1007,1012,1072,1075,1105,1108,1112,1119,1124,1230,1241,1252,1258,1261,1266,1276,1281,1294,1297,1301,1305,1314,1322,1332,1348,1352,1571,1576,1579,1588,1592,1658,1664,1668,1764,1767,1793,1797,1803,1807,1970,1973,1978,1983,1993,1996],[338,339,340],"p",{},"In my company, we use Docker and Docker Compose to run our Node.js services locally. Recently, I\nneeded to configure and run the VSCode debugger on some of these services to debug a feature. There\nare a few things to know to achieve this, which I will share in this article with some basic\nexamples.",[338,342,343],{},"Before we start, here are the points that will serve as a guideline in this tutorial:",[345,346,347,351],"ul",{},[348,349,350],"li",{},"We want to keep using Docker and Docker compose to run our services, so that we have the proper\nenvironment for each of these services (environment variables, etc).",[348,352,353,354,358],{},"We do not want to touch the current ",[355,356,357],"code",{},"docker-compose.yml"," which could, potentially, be used in the\nfuture to deploy our services in production.",[360,361,363],"h2",{"id":362},"the-sample-application","The Sample Application",[338,365,366,367,370],{},"Let's start by creating a first service. It is a simple web server that concatenates two strings, a\nfirst name and a last name, and returns the result. This service will live in a ",[355,368,369],{},"webapp\u002F"," directory\nat the root of the project.",[372,373,375],"h3",{"id":374},"the-nodejs-code","The Node.JS code",[338,377,378],{},[355,379,380],{},"webapp\u002Fpackage.json",[382,383,387],"pre",{"className":384,"code":385,"language":386,"meta":11,"style":11},"language-json shiki shiki-themes github-light github-dark","{\n  \"name\": \"webapp\",\n  \"scripts\": {\n    \"start\": \"node src\u002Fserver.js\"\n  },\n  \"dependencies\": {\n    \"express\": \"^4.16.1\"\n  }\n}\n","json",[355,388,389,397,413,422,433,439,447,458,464],{"__ignoreMap":11},[390,391,393],"span",{"class":392,"line":19},"line",[390,394,396],{"class":395},"sVt8B","{\n",[390,398,399,403,406,410],{"class":392,"line":12},[390,400,402],{"class":401},"sj4cs","  \"name\"",[390,404,405],{"class":395},": ",[390,407,409],{"class":408},"sZZnC","\"webapp\"",[390,411,412],{"class":395},",\n",[390,414,416,419],{"class":392,"line":415},3,[390,417,418],{"class":401},"  \"scripts\"",[390,420,421],{"class":395},": {\n",[390,423,425,428,430],{"class":392,"line":424},4,[390,426,427],{"class":401},"    \"start\"",[390,429,405],{"class":395},[390,431,432],{"class":408},"\"node src\u002Fserver.js\"\n",[390,434,436],{"class":392,"line":435},5,[390,437,438],{"class":395},"  },\n",[390,440,442,445],{"class":392,"line":441},6,[390,443,444],{"class":401},"  \"dependencies\"",[390,446,421],{"class":395},[390,448,450,453,455],{"class":392,"line":449},7,[390,451,452],{"class":401},"    \"express\"",[390,454,405],{"class":395},[390,456,457],{"class":408},"\"^4.16.1\"\n",[390,459,461],{"class":392,"line":460},8,[390,462,463],{"class":395},"  }\n",[390,465,467],{"class":392,"line":466},9,[390,468,469],{"class":395},"}\n",[338,471,472],{},[355,473,474],{},"webapp\u002Fsrc\u002Fserver.js",[382,476,480],{"className":477,"code":478,"language":479,"meta":11,"style":11},"language-ts shiki shiki-themes github-light github-dark","const express = require(\"express\");\nconst app = express();\n\napp.get(\"\u002Ffullname\", (req, res) => {\n  const firstName = req.query.firstNme;\n  const lastName = req.query.lastName;\n  res.send(`${firstName} ${lastName}`);\n});\n\napp.listen(8080, () => console.log(\"Listening on port 8080...\"));\n","ts",[355,481,482,507,521,526,561,574,586,613,618,622],{"__ignoreMap":11},[390,483,484,488,491,494,498,501,504],{"class":392,"line":19},[390,485,487],{"class":486},"szBVR","const",[390,489,490],{"class":401}," express",[390,492,493],{"class":486}," =",[390,495,497],{"class":496},"sScJk"," require",[390,499,500],{"class":395},"(",[390,502,503],{"class":408},"\"express\"",[390,505,506],{"class":395},");\n",[390,508,509,511,514,516,518],{"class":392,"line":12},[390,510,487],{"class":486},[390,512,513],{"class":401}," app",[390,515,493],{"class":486},[390,517,490],{"class":496},[390,519,520],{"class":395},"();\n",[390,522,523],{"class":392,"line":415},[390,524,525],{"emptyLinePlaceholder":17},"\n",[390,527,528,531,534,536,539,542,546,549,552,555,558],{"class":392,"line":424},[390,529,530],{"class":395},"app.",[390,532,533],{"class":496},"get",[390,535,500],{"class":395},[390,537,538],{"class":408},"\"\u002Ffullname\"",[390,540,541],{"class":395},", (",[390,543,545],{"class":544},"s4XuR","req",[390,547,548],{"class":395},", ",[390,550,551],{"class":544},"res",[390,553,554],{"class":395},") ",[390,556,557],{"class":486},"=>",[390,559,560],{"class":395}," {\n",[390,562,563,566,569,571],{"class":392,"line":435},[390,564,565],{"class":486},"  const",[390,567,568],{"class":401}," firstName",[390,570,493],{"class":486},[390,572,573],{"class":395}," req.query.firstNme;\n",[390,575,576,578,581,583],{"class":392,"line":441},[390,577,565],{"class":486},[390,579,580],{"class":401}," lastName",[390,582,493],{"class":486},[390,584,585],{"class":395}," req.query.lastName;\n",[390,587,588,591,594,596,599,602,605,608,611],{"class":392,"line":449},[390,589,590],{"class":395},"  res.",[390,592,593],{"class":496},"send",[390,595,500],{"class":395},[390,597,598],{"class":408},"`${",[390,600,601],{"class":395},"firstName",[390,603,604],{"class":408},"} ${",[390,606,607],{"class":395},"lastName",[390,609,610],{"class":408},"}`",[390,612,506],{"class":395},[390,614,615],{"class":392,"line":460},[390,616,617],{"class":395},"});\n",[390,619,620],{"class":392,"line":466},[390,621,525],{"emptyLinePlaceholder":17},[390,623,625,627,630,632,635,638,640,643,646,648,651],{"class":392,"line":624},10,[390,626,530],{"class":395},[390,628,629],{"class":496},"listen",[390,631,500],{"class":395},[390,633,634],{"class":401},"8080",[390,636,637],{"class":395},", () ",[390,639,557],{"class":486},[390,641,642],{"class":395}," console.",[390,644,645],{"class":496},"log",[390,647,500],{"class":395},[390,649,650],{"class":408},"\"Listening on port 8080...\"",[390,652,653],{"class":395},"));\n",[338,655,656],{},[355,657,658],{},"webapp\u002FDockerfile",[382,660,664],{"className":661,"code":662,"language":663,"meta":11,"style":11},"language-dockerfile shiki shiki-themes github-light github-dark","FROM node:16\n\nWORKDIR \u002Fusr\u002Fsrc\u002Fapp\n\nCOPY package*.json .\u002F\n\nRUN npm install\nCOPY . .\n\nEXPOSE 8080\nCMD [ \"node\", \"src\u002Fserver.js\" ]\n","dockerfile",[355,665,666,674,678,686,690,698,702,710,717,721,729],{"__ignoreMap":11},[390,667,668,671],{"class":392,"line":19},[390,669,670],{"class":486},"FROM",[390,672,673],{"class":395}," node:16\n",[390,675,676],{"class":392,"line":12},[390,677,525],{"emptyLinePlaceholder":17},[390,679,680,683],{"class":392,"line":415},[390,681,682],{"class":486},"WORKDIR",[390,684,685],{"class":395}," \u002Fusr\u002Fsrc\u002Fapp\n",[390,687,688],{"class":392,"line":424},[390,689,525],{"emptyLinePlaceholder":17},[390,691,692,695],{"class":392,"line":435},[390,693,694],{"class":486},"COPY",[390,696,697],{"class":395}," package*.json .\u002F\n",[390,699,700],{"class":392,"line":441},[390,701,525],{"emptyLinePlaceholder":17},[390,703,704,707],{"class":392,"line":449},[390,705,706],{"class":486},"RUN",[390,708,709],{"class":395}," npm install\n",[390,711,712,714],{"class":392,"line":460},[390,713,694],{"class":486},[390,715,716],{"class":395}," . .\n",[390,718,719],{"class":392,"line":466},[390,720,525],{"emptyLinePlaceholder":17},[390,722,723,726],{"class":392,"line":624},[390,724,725],{"class":486},"EXPOSE",[390,727,728],{"class":395}," 8080\n",[390,730,732,735,738,741,743,746],{"class":392,"line":731},11,[390,733,734],{"class":486},"CMD",[390,736,737],{"class":395}," [ ",[390,739,740],{"class":408},"\"node\"",[390,742,548],{"class":395},[390,744,745],{"class":408},"\"src\u002Fserver.js\"",[390,747,748],{"class":395}," ]\n",[338,750,751],{},[355,752,753],{},"webapp\u002F.dockerignore",[382,755,760],{"className":756,"code":758,"language":759},[757],"language-text","node_modules\nnpm-debug.log\n","text",[355,761,758],{"__ignoreMap":11},[372,763,765],{"id":764},"the-docker-configuration","The Docker configuration",[338,767,768,769,772,773,775],{},"Now that the application code is written and the ",[355,770,771],{},"Dockerfile"," created, we can add a\n",[355,774,357],{}," file at the root of the project.",[338,777,778],{},[355,779,357],{},[382,781,785],{"className":782,"code":783,"language":784,"meta":11,"style":11},"language-yml shiki shiki-themes github-light github-dark","services:\n  webapp:\n        build: .\u002Fwebapp\n        ports:\n            - \"127.0.0.1:8080:8080\"\n","yml",[355,786,787,796,803,813,820],{"__ignoreMap":11},[390,788,789,793],{"class":392,"line":19},[390,790,792],{"class":791},"s9eBZ","services",[390,794,795],{"class":395},":\n",[390,797,798,801],{"class":392,"line":12},[390,799,800],{"class":791},"  webapp",[390,802,795],{"class":395},[390,804,805,808,810],{"class":392,"line":415},[390,806,807],{"class":791},"        build",[390,809,405],{"class":395},[390,811,812],{"class":408},".\u002Fwebapp\n",[390,814,815,818],{"class":392,"line":424},[390,816,817],{"class":791},"        ports",[390,819,795],{"class":395},[390,821,822,825],{"class":392,"line":435},[390,823,824],{"class":395},"            - ",[390,826,827],{"class":408},"\"127.0.0.1:8080:8080\"\n",[338,829,830],{},"Let's start the service.",[382,832,836],{"className":833,"code":834,"language":835,"meta":11,"style":11},"language-sh shiki shiki-themes github-light github-dark","docker-compose build\ndocker-compose up -d\n","sh",[355,837,838,846],{"__ignoreMap":11},[390,839,840,843],{"class":392,"line":19},[390,841,842],{"class":496},"docker-compose",[390,844,845],{"class":408}," build\n",[390,847,848,850,853],{"class":392,"line":12},[390,849,842],{"class":496},[390,851,852],{"class":408}," up",[390,854,855],{"class":401}," -d\n",[338,857,858,859,865,868,869,872],{},"If you go to\n",[860,861],"a",{"href":862,"rel":863},"http:\u002F\u002Flocalhost:8080\u002Ffullname?firstName=Foo&lastName=Bar",[864],"nofollow",[860,866,862],{"href":862,"rel":867},[864],",\nyou should see the string ",[355,870,871],{},"undefined Bar",", which is the unexpected behavior we will debug.",[360,874,876],{"id":875},"debugging-the-application-in-docker-with-vscode","Debugging the Application in Docker with VSCode",[372,878,880],{"id":879},"the-debugger-command","The debugger command",[338,882,883,884,887],{},"To allow the future VSCode debugger to attach to the Node service, we need to specify it when we\nstart the process by adding the ",[355,885,886],{},"--inpect"," flag.",[889,890,891],"blockquote",{},[338,892,893,894,897,898,901,902,905,906,909],{},"Simply using ",[355,895,896],{},"--inspect"," or ",[355,899,900],{},"--inspect=127.0.0.1:9229"," is not sufficient here because we need the\n",[355,903,904],{},"9229"," port to be accessible from outside the service, which is allowed by the ",[355,907,908],{},"0.0.0.0"," address.\nSo this command should only be used when you run the debugger in a Docker service. Otherwise, you\nwould expose the port and the debugger to anyone on the Internet.",[338,911,912],{},[355,913,380],{},[382,915,917],{"className":384,"code":916,"language":386,"meta":11,"style":11},"{\n  \"name\": \"webapp\",\n  \"scripts\": {\n    \"start\": \"node src\u002Fserver.js\",\n    \"start:docker:debug\": \"node --inspect=0.0.0.0:9229 src\u002Fserver.js\"\n  },\n  \"dependencies\": {\n    \"express\": \"^4.16.1\"\n  }\n}\n",[355,918,919,923,933,939,950,960,964,970,978,982],{"__ignoreMap":11},[390,920,921],{"class":392,"line":19},[390,922,396],{"class":395},[390,924,925,927,929,931],{"class":392,"line":12},[390,926,402],{"class":401},[390,928,405],{"class":395},[390,930,409],{"class":408},[390,932,412],{"class":395},[390,934,935,937],{"class":392,"line":415},[390,936,418],{"class":401},[390,938,421],{"class":395},[390,940,941,943,945,948],{"class":392,"line":424},[390,942,427],{"class":401},[390,944,405],{"class":395},[390,946,947],{"class":408},"\"node src\u002Fserver.js\"",[390,949,412],{"class":395},[390,951,952,955,957],{"class":392,"line":435},[390,953,954],{"class":401},"    \"start:docker:debug\"",[390,956,405],{"class":395},[390,958,959],{"class":408},"\"node --inspect=0.0.0.0:9229 src\u002Fserver.js\"\n",[390,961,962],{"class":392,"line":441},[390,963,438],{"class":395},[390,965,966,968],{"class":392,"line":449},[390,967,444],{"class":401},[390,969,421],{"class":395},[390,971,972,974,976],{"class":392,"line":460},[390,973,452],{"class":401},[390,975,405],{"class":395},[390,977,457],{"class":408},[390,979,980],{"class":392,"line":466},[390,981,463],{"class":395},[390,983,984],{"class":392,"line":624},[390,985,469],{"class":395},[372,987,765],{"id":988},"the-docker-configuration-1",[338,990,991,992,994,995,998,999,1003,1004,1006],{},"Following our guideline, we do not modify the initial ",[355,993,357],{}," but create a second one\nthat extends the first one. We will use the ",[355,996,997],{},"[f","\nflag](",[860,1000,1001],{"href":1001,"rel":1002},"https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Freference\u002F#use--f-to-specify-name-and-path-of-one-or-more-compose-files",[864],")\nof the ",[355,1005,842],{}," CLI to use them both.",[338,1008,1009],{},[355,1010,1011],{},"docker-compose.debug.yml",[382,1013,1015],{"className":782,"code":1014,"language":784,"meta":11,"style":11},"services:\n    webapp:\n        command: [ 'npm', 'run', 'start:docker:debug' ]\n        ports:\n            - \"127.0.0.1:8080:8080\"\n            - \"127.0.0.1:9229:9229\"\n",[355,1016,1017,1023,1030,1053,1059,1065],{"__ignoreMap":11},[390,1018,1019,1021],{"class":392,"line":19},[390,1020,792],{"class":791},[390,1022,795],{"class":395},[390,1024,1025,1028],{"class":392,"line":12},[390,1026,1027],{"class":791},"    webapp",[390,1029,795],{"class":395},[390,1031,1032,1035,1038,1041,1043,1046,1048,1051],{"class":392,"line":415},[390,1033,1034],{"class":791},"        command",[390,1036,1037],{"class":395},": [ ",[390,1039,1040],{"class":408},"'npm'",[390,1042,548],{"class":395},[390,1044,1045],{"class":408},"'run'",[390,1047,548],{"class":395},[390,1049,1050],{"class":408},"'start:docker:debug'",[390,1052,748],{"class":395},[390,1054,1055,1057],{"class":392,"line":424},[390,1056,817],{"class":791},[390,1058,795],{"class":395},[390,1060,1061,1063],{"class":392,"line":435},[390,1062,824],{"class":395},[390,1064,827],{"class":408},[390,1066,1067,1069],{"class":392,"line":441},[390,1068,824],{"class":395},[390,1070,1071],{"class":408},"\"127.0.0.1:9229:9229\"\n",[338,1073,1074],{},"Then, to restart the service with debug mode enabled, you can use this command:",[382,1076,1078],{"className":833,"code":1077,"language":835,"meta":11,"style":11},"docker-compose build\ndocker-compose -f docker-compose.yml -f docker-compose.debug.yml up -d\n",[355,1079,1080,1086],{"__ignoreMap":11},[390,1081,1082,1084],{"class":392,"line":19},[390,1083,842],{"class":496},[390,1085,845],{"class":408},[390,1087,1088,1090,1093,1096,1098,1101,1103],{"class":392,"line":12},[390,1089,842],{"class":496},[390,1091,1092],{"class":401}," -f",[390,1094,1095],{"class":408}," docker-compose.yml",[390,1097,1092],{"class":401},[390,1099,1100],{"class":408}," docker-compose.debug.yml",[390,1102,852],{"class":408},[390,1104,855],{"class":401},[338,1106,1107],{},"The service is now ready to be attached to the VSCode debugger.",[372,1109,1111],{"id":1110},"running-the-debugger-with-vscode","Running the debugger with VSCode",[338,1113,1114,1115,1118],{},"At the root of your project, create a new directory ",[355,1116,1117],{},".vscode"," and add the following configuration\nfile.",[338,1120,1121],{},[355,1122,1123],{},".vscode\u002Flaunch.json",[382,1125,1127],{"className":384,"code":1126,"language":386,"meta":11,"style":11},"{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"attach\",\n      \"name\": \"Debug webapp\",\n      \"remoteRoot\": \"\u002Fapp\u002Fsrc\",\n      \"localRoot\": \"${workspaceFolder}\u002Fwebapp\u002Fsrc\"\n    }\n  ]\n}\n",[355,1128,1129,1133,1145,1153,1158,1169,1181,1193,1205,1215,1220,1225],{"__ignoreMap":11},[390,1130,1131],{"class":392,"line":19},[390,1132,396],{"class":395},[390,1134,1135,1138,1140,1143],{"class":392,"line":12},[390,1136,1137],{"class":401},"  \"version\"",[390,1139,405],{"class":395},[390,1141,1142],{"class":408},"\"0.2.0\"",[390,1144,412],{"class":395},[390,1146,1147,1150],{"class":392,"line":415},[390,1148,1149],{"class":401},"  \"configurations\"",[390,1151,1152],{"class":395},": [\n",[390,1154,1155],{"class":392,"line":424},[390,1156,1157],{"class":395},"    {\n",[390,1159,1160,1163,1165,1167],{"class":392,"line":435},[390,1161,1162],{"class":401},"      \"type\"",[390,1164,405],{"class":395},[390,1166,740],{"class":408},[390,1168,412],{"class":395},[390,1170,1171,1174,1176,1179],{"class":392,"line":441},[390,1172,1173],{"class":401},"      \"request\"",[390,1175,405],{"class":395},[390,1177,1178],{"class":408},"\"attach\"",[390,1180,412],{"class":395},[390,1182,1183,1186,1188,1191],{"class":392,"line":449},[390,1184,1185],{"class":401},"      \"name\"",[390,1187,405],{"class":395},[390,1189,1190],{"class":408},"\"Debug webapp\"",[390,1192,412],{"class":395},[390,1194,1195,1198,1200,1203],{"class":392,"line":460},[390,1196,1197],{"class":401},"      \"remoteRoot\"",[390,1199,405],{"class":395},[390,1201,1202],{"class":408},"\"\u002Fapp\u002Fsrc\"",[390,1204,412],{"class":395},[390,1206,1207,1210,1212],{"class":392,"line":466},[390,1208,1209],{"class":401},"      \"localRoot\"",[390,1211,405],{"class":395},[390,1213,1214],{"class":408},"\"${workspaceFolder}\u002Fwebapp\u002Fsrc\"\n",[390,1216,1217],{"class":392,"line":624},[390,1218,1219],{"class":395},"    }\n",[390,1221,1222],{"class":392,"line":731},[390,1223,1224],{"class":395},"  ]\n",[390,1226,1228],{"class":392,"line":1227},12,[390,1229,469],{"class":395},[338,1231,1232,1233,1236,1237,1240],{},"When adding a breakpoint, the ",[355,1234,1235],{},"remoteRoot"," and ",[355,1238,1239],{},"localRoot"," properties will match the file's position\nin the VSCode environment and its location in the Docker service file system.",[338,1242,1243,1244,1247,1248,1251],{},"You can now start the debugger on the ",[355,1245,1246],{},"webapp"," service. Open the debugging panel and select the\n",[355,1249,1250],{},"Debug webapp"," option. Then click on the play button.",[338,1253,1254],{},[1255,1256],"img",{"alt":11,"src":1257},"\u002Fimages\u002Fstart-debugger.png",[338,1259,1260],{},"The debugger is started.",[338,1262,1263],{},[1255,1264],{"alt":11,"src":1265},"\u002Fimages\u002Fadd-breakpoint.png",[338,1267,1268,1269,1272,1275],{},"Add a breakpoint on line 6 and then go to\n",[860,1270],{"href":862,"rel":1271},[864],[860,1273,862],{"href":862,"rel":1274},[864],".",[338,1277,1278],{},[1255,1279],{"alt":11,"src":1280},"\u002Fimages\u002Frun-debugger.png",[338,1282,1283,1284,1286,1287,1290,1291,1293],{},"The debugger stops on line 6 and we can see that the variable ",[355,1285,601],{}," is ",[355,1288,1289],{},"undefined",". The\nproblem comes from line 5 where this is a typo on the ",[355,1292,601],{}," parameter name.",[338,1295,1296],{},"To close the debugger, click on the button with a red square.",[360,1298,1300],{"id":1299},"debugging-multiple-docker-services","Debugging Multiple Docker Services",[372,1302,1304],{"id":1303},"the-nodejs-micro-service","The Node.JS micro-service",[338,1306,1307,1308,1311,1312,1275],{},"To take this a step further, we will add another service, named ",[355,1309,1310],{},"micro-service",", which will be\ncalled by ",[355,1313,1246],{},[338,1315,1316,1317,1319,1320,1275],{},"First, copy and paste the contents of the ",[355,1318,1246],{}," directory into another directory named\n",[355,1321,1310],{},[338,1323,1324,1325,1327,1328,1331],{},"Then, in the ",[355,1326,1246],{}," directory, install ",[355,1329,1330],{},"axios"," and update the code as follows.",[382,1333,1335],{"className":833,"code":1334,"language":835,"meta":11,"style":11},"npm install axios\n",[355,1336,1337],{"__ignoreMap":11},[390,1338,1339,1342,1345],{"class":392,"line":19},[390,1340,1341],{"class":496},"npm",[390,1343,1344],{"class":408}," install",[390,1346,1347],{"class":408}," axios\n",[338,1349,1350],{},[355,1351,474],{},[382,1353,1355],{"className":477,"code":1354,"language":479,"meta":11,"style":11},"const express = require(\"express\");\nconst axios = require(\"axios\");\n\nconst app = express();\n\napp.get(\"\u002Ffullname\", async (req, res, next) => {\n  try {\n    const { data: fullName } = await axios.get(\"\u003Chttp:\u002F\u002Fmicro-service:8080\u002Ffullname>\", {\n      params: req.query,\n    });\n    res.send(fullName);\n  } catch (err) {\n    next(err);\n  }\n});\n\napp.listen(8080, () => console.log(\"Listening on port 8080...\"));\n",[355,1356,1357,1373,1391,1395,1407,1411,1446,1453,1491,1496,1501,1511,1522,1531,1536,1541,1546],{"__ignoreMap":11},[390,1358,1359,1361,1363,1365,1367,1369,1371],{"class":392,"line":19},[390,1360,487],{"class":486},[390,1362,490],{"class":401},[390,1364,493],{"class":486},[390,1366,497],{"class":496},[390,1368,500],{"class":395},[390,1370,503],{"class":408},[390,1372,506],{"class":395},[390,1374,1375,1377,1380,1382,1384,1386,1389],{"class":392,"line":12},[390,1376,487],{"class":486},[390,1378,1379],{"class":401}," axios",[390,1381,493],{"class":486},[390,1383,497],{"class":496},[390,1385,500],{"class":395},[390,1387,1388],{"class":408},"\"axios\"",[390,1390,506],{"class":395},[390,1392,1393],{"class":392,"line":415},[390,1394,525],{"emptyLinePlaceholder":17},[390,1396,1397,1399,1401,1403,1405],{"class":392,"line":424},[390,1398,487],{"class":486},[390,1400,513],{"class":401},[390,1402,493],{"class":486},[390,1404,490],{"class":496},[390,1406,520],{"class":395},[390,1408,1409],{"class":392,"line":435},[390,1410,525],{"emptyLinePlaceholder":17},[390,1412,1413,1415,1417,1419,1421,1423,1426,1429,1431,1433,1435,1437,1440,1442,1444],{"class":392,"line":441},[390,1414,530],{"class":395},[390,1416,533],{"class":496},[390,1418,500],{"class":395},[390,1420,538],{"class":408},[390,1422,548],{"class":395},[390,1424,1425],{"class":486},"async",[390,1427,1428],{"class":395}," (",[390,1430,545],{"class":544},[390,1432,548],{"class":395},[390,1434,551],{"class":544},[390,1436,548],{"class":395},[390,1438,1439],{"class":544},"next",[390,1441,554],{"class":395},[390,1443,557],{"class":486},[390,1445,560],{"class":395},[390,1447,1448,1451],{"class":392,"line":449},[390,1449,1450],{"class":486},"  try",[390,1452,560],{"class":395},[390,1454,1455,1458,1461,1464,1466,1469,1472,1475,1478,1481,1483,1485,1488],{"class":392,"line":460},[390,1456,1457],{"class":486},"    const",[390,1459,1460],{"class":395}," { ",[390,1462,1463],{"class":544},"data",[390,1465,405],{"class":395},[390,1467,1468],{"class":401},"fullName",[390,1470,1471],{"class":395}," } ",[390,1473,1474],{"class":486},"=",[390,1476,1477],{"class":486}," await",[390,1479,1480],{"class":395}," axios.",[390,1482,533],{"class":496},[390,1484,500],{"class":395},[390,1486,1487],{"class":408},"\"\u003Chttp:\u002F\u002Fmicro-service:8080\u002Ffullname>\"",[390,1489,1490],{"class":395},", {\n",[390,1492,1493],{"class":392,"line":466},[390,1494,1495],{"class":395},"      params: req.query,\n",[390,1497,1498],{"class":392,"line":624},[390,1499,1500],{"class":395},"    });\n",[390,1502,1503,1506,1508],{"class":392,"line":731},[390,1504,1505],{"class":395},"    res.",[390,1507,593],{"class":496},[390,1509,1510],{"class":395},"(fullName);\n",[390,1512,1513,1516,1519],{"class":392,"line":1227},[390,1514,1515],{"class":395},"  } ",[390,1517,1518],{"class":486},"catch",[390,1520,1521],{"class":395}," (err) {\n",[390,1523,1525,1528],{"class":392,"line":1524},13,[390,1526,1527],{"class":496},"    next",[390,1529,1530],{"class":395},"(err);\n",[390,1532,1534],{"class":392,"line":1533},14,[390,1535,463],{"class":395},[390,1537,1539],{"class":392,"line":1538},15,[390,1540,617],{"class":395},[390,1542,1544],{"class":392,"line":1543},16,[390,1545,525],{"emptyLinePlaceholder":17},[390,1547,1549,1551,1553,1555,1557,1559,1561,1563,1565,1567,1569],{"class":392,"line":1548},17,[390,1550,530],{"class":395},[390,1552,629],{"class":496},[390,1554,500],{"class":395},[390,1556,634],{"class":401},[390,1558,637],{"class":395},[390,1560,557],{"class":486},[390,1562,642],{"class":395},[390,1564,645],{"class":496},[390,1566,500],{"class":395},[390,1568,650],{"class":408},[390,1570,653],{"class":395},[889,1572,1573],{},[338,1574,1575],{},"The URL used line 8 is based on the name of the Docker service defined in the next section.",[372,1577,765],{"id":1578},"the-docker-configuration-2",[338,1580,1581,1582,1584,1585,1587],{},"Add the new service to your ",[355,1583,357],{},". Note that it uses a different port so as not to\nconflict with the ",[355,1586,1246],{}," service.",[338,1589,1590],{},[355,1591,357],{},[382,1593,1595],{"className":782,"code":1594,"language":784,"meta":11,"style":11},"services:\n    webapp:\n        build: .\u002Fwebapp\n        ports:\n            - \"127.0.0.1:8080:8080\"\n    micro-service:\n        build: .\u002Fmicro-service\n        ports:\n            - \"127.0.0.1:3001:8080\"\n",[355,1596,1597,1603,1609,1617,1623,1629,1636,1645,1651],{"__ignoreMap":11},[390,1598,1599,1601],{"class":392,"line":19},[390,1600,792],{"class":791},[390,1602,795],{"class":395},[390,1604,1605,1607],{"class":392,"line":12},[390,1606,1027],{"class":791},[390,1608,795],{"class":395},[390,1610,1611,1613,1615],{"class":392,"line":415},[390,1612,807],{"class":791},[390,1614,405],{"class":395},[390,1616,812],{"class":408},[390,1618,1619,1621],{"class":392,"line":424},[390,1620,817],{"class":791},[390,1622,795],{"class":395},[390,1624,1625,1627],{"class":392,"line":435},[390,1626,824],{"class":395},[390,1628,827],{"class":408},[390,1630,1631,1634],{"class":392,"line":441},[390,1632,1633],{"class":791},"    micro-service",[390,1635,795],{"class":395},[390,1637,1638,1640,1642],{"class":392,"line":449},[390,1639,807],{"class":791},[390,1641,405],{"class":395},[390,1643,1644],{"class":408},".\u002Fmicro-service\n",[390,1646,1647,1649],{"class":392,"line":460},[390,1648,817],{"class":791},[390,1650,795],{"class":395},[390,1652,1653,1655],{"class":392,"line":466},[390,1654,824],{"class":395},[390,1656,1657],{"class":408},"\"127.0.0.1:3001:8080\"\n",[338,1659,1660,1661,1663],{},"Then, in your ",[355,1662,1011],{},", add the new service as well. Note that the debugger port\nis also different from the first one.",[338,1665,1666],{},[355,1667,1011],{},[382,1669,1671],{"className":782,"code":1670,"language":784,"meta":11,"style":11},"services:\n    webapp:\n        command: [ 'npm', 'run', 'start:docker:debug' ]\n        ports:\n            - \"127.0.0.1:8080:8080\"\n            - \"127.0.0.1:9229:9229\"\n    micro-service:\n        command: [ 'npm', 'run', 'start:docker:debug' ]\n        ports:\n            - \"127.0.0.1:3001:8080\"\n            - \"127.0.0.1:9230:9229\"\n",[355,1672,1673,1679,1685,1703,1709,1715,1721,1727,1745,1751,1757],{"__ignoreMap":11},[390,1674,1675,1677],{"class":392,"line":19},[390,1676,792],{"class":791},[390,1678,795],{"class":395},[390,1680,1681,1683],{"class":392,"line":12},[390,1682,1027],{"class":791},[390,1684,795],{"class":395},[390,1686,1687,1689,1691,1693,1695,1697,1699,1701],{"class":392,"line":415},[390,1688,1034],{"class":791},[390,1690,1037],{"class":395},[390,1692,1040],{"class":408},[390,1694,548],{"class":395},[390,1696,1045],{"class":408},[390,1698,548],{"class":395},[390,1700,1050],{"class":408},[390,1702,748],{"class":395},[390,1704,1705,1707],{"class":392,"line":424},[390,1706,817],{"class":791},[390,1708,795],{"class":395},[390,1710,1711,1713],{"class":392,"line":435},[390,1712,824],{"class":395},[390,1714,827],{"class":408},[390,1716,1717,1719],{"class":392,"line":441},[390,1718,824],{"class":395},[390,1720,1071],{"class":408},[390,1722,1723,1725],{"class":392,"line":449},[390,1724,1633],{"class":791},[390,1726,795],{"class":395},[390,1728,1729,1731,1733,1735,1737,1739,1741,1743],{"class":392,"line":460},[390,1730,1034],{"class":791},[390,1732,1037],{"class":395},[390,1734,1040],{"class":408},[390,1736,548],{"class":395},[390,1738,1045],{"class":408},[390,1740,548],{"class":395},[390,1742,1050],{"class":408},[390,1744,748],{"class":395},[390,1746,1747,1749],{"class":392,"line":466},[390,1748,817],{"class":791},[390,1750,795],{"class":395},[390,1752,1753,1755],{"class":392,"line":624},[390,1754,824],{"class":395},[390,1756,1657],{"class":408},[390,1758,1759,1761],{"class":392,"line":731},[390,1760,824],{"class":395},[390,1762,1763],{"class":408},"\"127.0.0.1:9230:9229\"\n",[338,1765,1766],{},"Now build and start the two services.",[382,1768,1769],{"className":833,"code":1077,"language":835,"meta":11,"style":11},[355,1770,1771,1777],{"__ignoreMap":11},[390,1772,1773,1775],{"class":392,"line":19},[390,1774,842],{"class":496},[390,1776,845],{"class":408},[390,1778,1779,1781,1783,1785,1787,1789,1791],{"class":392,"line":12},[390,1780,842],{"class":496},[390,1782,1092],{"class":401},[390,1784,1095],{"class":408},[390,1786,1092],{"class":401},[390,1788,1100],{"class":408},[390,1790,852],{"class":408},[390,1792,855],{"class":401},[372,1794,1796],{"id":1795},"running-multiple-debuggers-with-vscode","Running multiple debuggers with VSCode",[338,1798,1799,1800,1275],{},"The last thing to do is to add the configuration of the second debugger in ",[355,1801,1802],{},"launch.json",[338,1804,1805],{},[355,1806,1123],{},[382,1808,1810],{"className":384,"code":1809,"language":386,"meta":11,"style":11},"{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"attach\",\n      \"name\": \"Debug webapp\",\n      \"remoteRoot\": \"\u002Fapp\u002Fsrc\",\n      \"localRoot\": \"${workspaceFolder}\u002Fwebapp\u002Fsrc\"\n    },\n    {\n      \"type\": \"node\",\n      \"request\": \"attach\",\n      \"name\": \"Debug micro-service\",\n      \"port\": 9230,\n      \"remoteRoot\": \"\u002Fapp\u002Fsrc\",\n      \"localRoot\": \"${workspaceFolder}\u002Fmicro-service\u002Fsrc\"\n    }\n  ]\n}\n",[355,1811,1812,1816,1826,1832,1836,1846,1856,1866,1876,1884,1889,1893,1903,1913,1924,1936,1946,1955,1960,1965],{"__ignoreMap":11},[390,1813,1814],{"class":392,"line":19},[390,1815,396],{"class":395},[390,1817,1818,1820,1822,1824],{"class":392,"line":12},[390,1819,1137],{"class":401},[390,1821,405],{"class":395},[390,1823,1142],{"class":408},[390,1825,412],{"class":395},[390,1827,1828,1830],{"class":392,"line":415},[390,1829,1149],{"class":401},[390,1831,1152],{"class":395},[390,1833,1834],{"class":392,"line":424},[390,1835,1157],{"class":395},[390,1837,1838,1840,1842,1844],{"class":392,"line":435},[390,1839,1162],{"class":401},[390,1841,405],{"class":395},[390,1843,740],{"class":408},[390,1845,412],{"class":395},[390,1847,1848,1850,1852,1854],{"class":392,"line":441},[390,1849,1173],{"class":401},[390,1851,405],{"class":395},[390,1853,1178],{"class":408},[390,1855,412],{"class":395},[390,1857,1858,1860,1862,1864],{"class":392,"line":449},[390,1859,1185],{"class":401},[390,1861,405],{"class":395},[390,1863,1190],{"class":408},[390,1865,412],{"class":395},[390,1867,1868,1870,1872,1874],{"class":392,"line":460},[390,1869,1197],{"class":401},[390,1871,405],{"class":395},[390,1873,1202],{"class":408},[390,1875,412],{"class":395},[390,1877,1878,1880,1882],{"class":392,"line":466},[390,1879,1209],{"class":401},[390,1881,405],{"class":395},[390,1883,1214],{"class":408},[390,1885,1886],{"class":392,"line":624},[390,1887,1888],{"class":395},"    },\n",[390,1890,1891],{"class":392,"line":731},[390,1892,1157],{"class":395},[390,1894,1895,1897,1899,1901],{"class":392,"line":1227},[390,1896,1162],{"class":401},[390,1898,405],{"class":395},[390,1900,740],{"class":408},[390,1902,412],{"class":395},[390,1904,1905,1907,1909,1911],{"class":392,"line":1524},[390,1906,1173],{"class":401},[390,1908,405],{"class":395},[390,1910,1178],{"class":408},[390,1912,412],{"class":395},[390,1914,1915,1917,1919,1922],{"class":392,"line":1533},[390,1916,1185],{"class":401},[390,1918,405],{"class":395},[390,1920,1921],{"class":408},"\"Debug micro-service\"",[390,1923,412],{"class":395},[390,1925,1926,1929,1931,1934],{"class":392,"line":1538},[390,1927,1928],{"class":401},"      \"port\"",[390,1930,405],{"class":395},[390,1932,1933],{"class":401},"9230",[390,1935,412],{"class":395},[390,1937,1938,1940,1942,1944],{"class":392,"line":1543},[390,1939,1197],{"class":401},[390,1941,405],{"class":395},[390,1943,1202],{"class":408},[390,1945,412],{"class":395},[390,1947,1948,1950,1952],{"class":392,"line":1548},[390,1949,1209],{"class":401},[390,1951,405],{"class":395},[390,1953,1954],{"class":408},"\"${workspaceFolder}\u002Fmicro-service\u002Fsrc\"\n",[390,1956,1958],{"class":392,"line":1957},18,[390,1959,1219],{"class":395},[390,1961,1963],{"class":392,"line":1962},19,[390,1964,1224],{"class":395},[390,1966,1968],{"class":392,"line":1967},20,[390,1969,469],{"class":395},[338,1971,1972],{},"Once the configuration is added, you can run the two debuggers for each service.",[338,1974,1975],{},[1255,1976],{"alt":11,"src":1977},"\u002Fimages\u002Fstart-webapp-debugger.png",[338,1979,1980],{},[1255,1981],{"alt":11,"src":1982},"\u002Fimages\u002Fstart-micro-service-debugger.png",[338,1984,1985,1986,1989,1992],{},"Once both debuggers are started, add a breakpoint in each service and go to\n",[860,1987],{"href":862,"rel":1988},[864],[860,1990,862],{"href":862,"rel":1991},[864],".\nThe application will stop successively on each breakpoint.",[338,1994,1995],{},"Your VSCode debugger is now fully configured to work with your Docker services. Congratulations!",[1997,1998,1999],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":11,"searchDepth":12,"depth":12,"links":2001},[2002,2006,2011],{"id":362,"depth":12,"text":363,"children":2003},[2004,2005],{"id":374,"depth":415,"text":375},{"id":764,"depth":415,"text":765},{"id":875,"depth":12,"text":876,"children":2007},[2008,2009,2010],{"id":879,"depth":415,"text":880},{"id":988,"depth":415,"text":765},{"id":1110,"depth":415,"text":1111},{"id":1299,"depth":12,"text":1300,"children":2012},[2013,2014,2015],{"id":1303,"depth":415,"text":1304},{"id":1578,"depth":415,"text":765},{"id":1795,"depth":415,"text":1796},"2022-06-10","In my company, we use Docker and Docker Compose to run our Node.js services locally. Recently, I needed to configure and run the VSCode debugger on some of...","en",{},"\u002Farticles\u002F2022-06-10-how-to-use-vscode-debugger-with-multiple-docker-services",{"title":333,"description":2017},"articles\u002F2022-06-10-how-to-use-vscode-debugger-with-multiple-docker-services",[2024],"dev","k25oDu70V_bSBsuWn05HINg7mLX-vXDTwmPzllNdvPg",1778159243891]