Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Fix for #315
Browse files Browse the repository at this point in the history
  • Loading branch information
lucj committed Aug 9, 2017
1 parent 2fbfc83 commit 5eb8f4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
16 changes: 9 additions & 7 deletions developer-tools/nodejs-debugging/VSCode-README.md
Expand Up @@ -23,11 +23,11 @@ We've created a simple application which includes an error. You can see the app
Let's take a look at the `Dockerfile`:

```
FROM node:8.2.1
FROM node:8.2.1-alpine
WORKDIR /code
RUN npm install -g nodemon
RUN npm install -g nodemon@1.11.0
COPY package.json /code/package.json
RUN npm install && npm ls
Expand Down Expand Up @@ -66,7 +66,8 @@ A few things are going on here:


### Run the app
Using your terminal, navigate to the directory with the app files and start up the app:

Using your terminal, navigate to the *app* directory (where the docker-compose.yml file is located) and start up the application:

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

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

A JSON file will be created and displayed. Replace its contents with the following:
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

```
{
"version": "0.2.0",
Expand All @@ -116,7 +118,7 @@ A JSON file will be created and displayed. Replace its contents with the followi
"restart": true,
"sourceMaps": false,
"outFiles": [],
"localRoot": "${workspaceRoot}/app",
"localRoot": "${workspaceRoot}/",
"remoteRoot": "/code"
}
]
Expand Down Expand Up @@ -162,4 +164,4 @@ Remove the breakpoint and detach the debugger by clicking the stop button. Go ba

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

And that's it, you're done!
And that's it, you're done!
6 changes: 3 additions & 3 deletions developer-tools/nodejs-debugging/app/Dockerfile
@@ -1,13 +1,13 @@
FROM node:8.2.1
FROM node:8.2.1-alpine

WORKDIR /code

RUN npm install -g nodemon
RUN npm install -g nodemon@1.11.0

COPY package.json /code/package.json
RUN npm install && npm ls
RUN mv /code/node_modules /node_modules

COPY . /code

CMD ["npm", "start"]
CMD ["npm", "start"]
6 changes: 3 additions & 3 deletions developer-tools/nodejs-debugging/app/docker-compose.yml
@@ -1,11 +1,11 @@
version: "2"
version: "3"

services:
web:
build: .
command: nodemon --inspect=5858
command: nodemon --inspect=0.0.0.0:5858
volumes:
- .:/code
ports:
- "8000:8000"
- "5858:5858"
- "5858:5858"

0 comments on commit 5eb8f4e

Please sign in to comment.