A Crude Debug Mode For a Dockerized NestJS App
[!CAUTION]
Why I say crude? Because you need to write debugger and cannot use breakpoints :/.
-
Create a
Dockerfileas we did here.https://github.com/kasir-barati/nestjs-materials/blob/5155bff1fca4fccb4e66bc19e8472c44b19b20e9/docker/vscode-dev-mode/Dockerfile#L1-L19
-
Create and expose
9229port in yourcomposefile, see here.https://github.com/kasir-barati/nestjs-materials/blob/5155bff1fca4fccb4e66bc19e8472c44b19b20e9/docker/vscode-dev-mode/compose.yml#L1-L12
-
Create
launch.json.https://github.com/kasir-barati/nestjs-materials/blob/5155bff1fca4fccb4e66bc19e8472c44b19b20e9/.vscode/launch.json#L1-L18