Skip to content

Instantly share code, notes, and snippets.

@lg
Created June 30, 2023 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lg/78fe20be0249cf2890b051b94d88ba90 to your computer and use it in GitHub Desktop.
Save lg/78fe20be0249cf2890b051b94d88ba90 to your computer and use it in GitHub Desktop.
vscode launch.json to start a server in docker and debug it (originally from awardwiz)
{
"recommendations": [
"spadin.memento-inputs"
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Run scraper with Docker", // Edit the parameters in tasks.json
"request": "attach",
"type": "node",
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"preLaunchTask": "start scrapers docker",
"postDebugTask": "stop scrapers docker",
"address": "127.0.0.1",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/usr/src/awardwiz",
"continueOnAttach": true,
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "start scrapers docker",
"type": "process",
"command": "just",
"args": ["run-scraper-brk", "united", "SFO", "LAX", "2023-12-25"],
"dependsOn": "tsc: build - tsconfig.json",
"isBackground": true,
"problemMatcher": {
"base": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": "Debugger listening on .*",
"endsPattern": "Debugger listening on .*"
},
},
"runOptions": {
"instanceLimit": 1
},
"presentation": {
"showReuseMessage": false,
}
},
{
"label": "stop scrapers docker",
"type": "process",
"command": "bash",
"args": ["-c", "CONTAINER=$(docker ps | grep awardwiz | awk '{ print $1 }'); docker stop -t 0 $CONTAINER"],
"presentation": {
"close": true,
"reveal": "never"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment