From 971da43b239462ad85342180f6ae3963098b9fc4 Mon Sep 17 00:00:00 2001 From: Feyruz Yalcin Date: Wed, 23 Oct 2019 11:12:57 +0100 Subject: [PATCH 1/2] Correct the used port & consistent with the rest --- Docker-TypeScript/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker-TypeScript/README.md b/Docker-TypeScript/README.md index 2b38582..c1696c3 100644 --- a/Docker-TypeScript/README.md +++ b/Docker-TypeScript/README.md @@ -60,7 +60,7 @@ Add this `package.json` which lists the dependencies and defines some scripts fo "scripts": { "postinstall": "tsc -p ./src", "watch": "tsc -w -p ./src", - "debug": "nodemon --watch ./dist --inspect=0.0.0.0:9222 --nolazy ./dist/index.js", + "debug": "nodemon --watch ./dist --inspect=0.0.0.0:5858 --nolazy ./dist/index.js", "docker-debug": "docker-compose up", "start": "node ./dist/index.js" }, From 479fe1d0d65e61c579503ffed6550e9bcde06e1e Mon Sep 17 00:00:00 2001 From: Feyruz Yalcin Date: Wed, 23 Oct 2019 11:31:16 +0100 Subject: [PATCH 2/2] even more consistent --- Docker-TypeScript/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker-TypeScript/README.md b/Docker-TypeScript/README.md index c1696c3..6884d97 100644 --- a/Docker-TypeScript/README.md +++ b/Docker-TypeScript/README.md @@ -113,7 +113,7 @@ docker run -p 3000:3000 server ## Debugging in Docker -For debugging this server in the Docker container we could just make node's debug port 9222 available (via the '-p' flag from above) and attach VS Code to this. +For debugging this server in the Docker container we could just make node's debug port 5858 (i.e. the same port we specified for nodemon's "--inspect" option in the package.json file above) available via the '-p' flag from above and attach VS Code to this. But for a faster edit/compile/debug cycle we will use a more sophisticated approach by mounting the 'dist' folder of the VS Code workspace directly into the container running in Docker. Inside Docker we'll use 'nodemon' for tracking changes in the 'dist' folder and restart the node runtime automatically and in the VS Code workspace we'll use a watch task that automatically transpiles modified TypeScript source into the 'dist' folder.