X Tutup
Skip to content

Commit 5eb8f4e

Browse files
committed
1 parent 2fbfc83 commit 5eb8f4e

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

developer-tools/nodejs-debugging/VSCode-README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ We've created a simple application which includes an error. You can see the app
2323
Let's take a look at the `Dockerfile`:
2424

2525
```
26-
FROM node:8.2.1
26+
FROM node:8.2.1-alpine
2727
2828
WORKDIR /code
2929
30-
RUN npm install -g nodemon
30+
RUN npm install -g nodemon@1.11.0
3131
3232
COPY package.json /code/package.json
3333
RUN npm install && npm ls
@@ -66,7 +66,8 @@ A few things are going on here:
6666

6767

6868
### Run the app
69-
Using your terminal, navigate to the directory with the app files and start up the app:
69+
70+
Using your terminal, navigate to the *app* directory (where the docker-compose.yml file is located) and start up the application:
7071

7172
```
7273
$ docker-compose up
@@ -77,7 +78,7 @@ Docker Compose will build the image and start a container for the app. You shoul
7778
Creating network "nodeexample_default" with the default driver
7879
Creating nodeexample_web_1
7980
Attaching to nodeexample_web_1
80-
web_1 | [nodemon] 1.9.2
81+
web_1 | [nodemon] 1.11.0
8182
web_1 | [nodemon] to restart at any time, enter `rs`
8283
web_1 | [nodemon] watching: *.*
8384
web_1 | [nodemon] starting `node --inspect=0.0.0.0:5858 app.js`
@@ -102,7 +103,8 @@ Create a boilerplate debugger config by clicking the gear icon and selecting “
102103

103104
![Image of VS Code dropdown list](images/dropdown.png "Image of Visual Studio Code dropdown list")
104105

105-
A JSON file will be created and displayed. Replace its contents with the following:
106+
A JSON file will be created and displayed (on the filesystem this file is located at *app/.vscode/launch.json*). Replace its contents with the following
107+
106108
```
107109
{
108110
"version": "0.2.0",
@@ -116,7 +118,7 @@ A JSON file will be created and displayed. Replace its contents with the followi
116118
"restart": true,
117119
"sourceMaps": false,
118120
"outFiles": [],
119-
"localRoot": "${workspaceRoot}/app",
121+
"localRoot": "${workspaceRoot}/",
120122
"remoteRoot": "/code"
121123
}
122124
]
@@ -162,4 +164,4 @@ Remove the breakpoint and detach the debugger by clicking the stop button. Go ba
162164

163165
![Animated image of browser without error](images/attach.png "Animated image of browser without error")
164166

165-
And that's it, you're done!
167+
And that's it, you're done!
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM node:8.2.1
1+
FROM node:8.2.1-alpine
22

33
WORKDIR /code
44

5-
RUN npm install -g nodemon
5+
RUN npm install -g nodemon@1.11.0
66

77
COPY package.json /code/package.json
88
RUN npm install && npm ls
99
RUN mv /code/node_modules /node_modules
1010

1111
COPY . /code
1212

13-
CMD ["npm", "start"]
13+
CMD ["npm", "start"]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
version: "2"
1+
version: "3"
22

33
services:
44
web:
55
build: .
6-
command: nodemon --inspect=5858
6+
command: nodemon --inspect=0.0.0.0:5858
77
volumes:
88
- .:/code
99
ports:
1010
- "8000:8000"
11-
- "5858:5858"
11+
- "5858:5858"

0 commit comments

Comments
 (0)
X Tutup