Configure debugging from outside the container

This commit is contained in:
2022-08-18 19:20:22 +02:00
parent 317230c9c3
commit 29e3e6de23
4 changed files with 22 additions and 2 deletions

2
.gitignore vendored
View File

@@ -4,6 +4,8 @@
### Visual Studio Code ### ### Visual Studio Code ###
.vscode .vscode
# Except launch.json
!.vscode/launch.json
### Node ### ### Node ###
# Logs # Logs

16
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Docker: Attach to Node",
"type": "node",
"request": "attach",
"restart": true,
"port": 9229,
"address": "localhost",
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app",
"protocol": "inspector"
}
]
}

View File

@@ -2,4 +2,6 @@ version: "3.7"
services: services:
bot: bot:
command: sh -c "npm install && npm run dev" command: sh -c "npm install && npm run dev"
ports:
- "9229:9229"

View File

@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon index.js" "dev": "nodemon --inspect=0.0.0.0:9229 index.js"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",