From 5eb8f4e75d0ef5bca428c522be844c4e88cd0156 Mon Sep 17 00:00:00 2001 From: Luc Juggery Date: Wed, 9 Aug 2017 10:36:24 +0200 Subject: [PATCH] Fix for #315 --- .../nodejs-debugging/VSCode-README.md | 16 +++++++++------- developer-tools/nodejs-debugging/app/Dockerfile | 6 +++--- .../nodejs-debugging/app/docker-compose.yml | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/developer-tools/nodejs-debugging/VSCode-README.md b/developer-tools/nodejs-debugging/VSCode-README.md index 3b76d8ec27..a1752ec872 100644 --- a/developer-tools/nodejs-debugging/VSCode-README.md +++ b/developer-tools/nodejs-debugging/VSCode-README.md @@ -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 @@ -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 @@ -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` @@ -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", @@ -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" } ] @@ -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! \ No newline at end of file +And that's it, you're done! diff --git a/developer-tools/nodejs-debugging/app/Dockerfile b/developer-tools/nodejs-debugging/app/Dockerfile index fac3e19f68..e0cd7c881c 100644 --- a/developer-tools/nodejs-debugging/app/Dockerfile +++ b/developer-tools/nodejs-debugging/app/Dockerfile @@ -1,8 +1,8 @@ -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 @@ -10,4 +10,4 @@ RUN mv /code/node_modules /node_modules COPY . /code -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "start"] diff --git a/developer-tools/nodejs-debugging/app/docker-compose.yml b/developer-tools/nodejs-debugging/app/docker-compose.yml index 2d6c15ef10..3ab962098f 100644 --- a/developer-tools/nodejs-debugging/app/docker-compose.yml +++ b/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" \ No newline at end of file + - "5858:5858"