mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
add nodejs debugger
This commit is contained in:
parent
26b1cc8d2d
commit
772ef7e985
18
.vscode/launch.json
vendored
18
.vscode/launch.json
vendored
@ -1,7 +1,4 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
@ -46,6 +43,17 @@
|
||||
"port": 5678,
|
||||
"host": "127.0.0.1"
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"name": "Docker: Attach to Node",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"remoteRoot": "/work/",
|
||||
"port": 9229,
|
||||
"address": "localhost",
|
||||
"localRoot": "${workspaceFolder}/nodejs/src/",
|
||||
"protocol": "inspector",
|
||||
"restart": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ services:
|
||||
image: aimvector/nodejs:1.0.0
|
||||
build:
|
||||
context: ./nodejs
|
||||
target: prod
|
||||
target: debug
|
||||
#working_dir: /work #comment out for build.target:prod
|
||||
#entrypoint: /bin/sh #comment out for build.target:prod
|
||||
#stdin_open: true #comment out for build.target:prod
|
||||
@ -39,6 +39,7 @@ services:
|
||||
- ./nodejs/src/:/work
|
||||
ports:
|
||||
- 5002:5000
|
||||
- 9229:9229 #debug port
|
||||
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
|
||||
container_name: python
|
||||
image: aimvector/python:1.0.0
|
||||
|
@ -1,11 +1,18 @@
|
||||
FROM node:12.4.0-alpine as dev
|
||||
|
||||
FROM node:12.4.0-alpine as debug
|
||||
|
||||
WORKDIR /work/
|
||||
|
||||
COPY ./src/package.json /work/package.json
|
||||
RUN npm install
|
||||
RUN npm install -g nodemon
|
||||
|
||||
COPY ./src/ /work/
|
||||
|
||||
CMD node .
|
||||
CMD nodemon --inspect=0.0.0.0 server.js
|
||||
|
||||
FROM node:12.4.0-alpine as prod
|
||||
|
||||
COPY ./src/package.json /work/package.json
|
||||
RUN npm install
|
||||
|
||||
CMD node server.js
|
Loading…
x
Reference in New Issue
Block a user