
Other than that, no other requirements are there.įor the hasty ones, I have made the source code available as a repository. Setting Up the Project Prerequisitesīefore we move further, the system should have docker desktop and VS Code installed. If you love this article so far, please follow me and do check out other such awesome articles on my profile. We will also set up a remote debugging for the project. In this article, we will set up a NodeJS project to run inside a docker container. If you want to learn more Docker basics and need a cheat sheet for Docker CLI, here is an introductory article about it. Also, major cloud systems like AWS or Azure do support them out of the box. These containers can be run locally on your Windows, Mac & Linux. Secondly, the remote debugger needs configuration to connect the project inside the docker container.ĭocker helps create portable containers that are fast and easy to deploy on various machines. Instead, the docker container should expose its container port. One won’t be directly able to run the project and connect to it via the debugger. Let’s say a project is running inside Docker. Secondly, remote debugging is also useful when the software is running inside a container. One can execute the software line by line to evaluate the issue and fix it. In this case, it would be very helpful to connect to the cloud and attach the debugger to the process. Now an issue happens on the cloud but not on the localhost. It might be deployed either for dev, UAT, or production. Consider a scenario where software is on the cloud. It is helpful for multiple reasons.įor one, one can debug software locally. That is, if you debug software running on a remote host, it's called remote debugging. Doing it remotely is called remote debugging :). What Is a Remote Debugger?ĭebugging is usually done on a localhost. For example, halting the execution will show memory consumed at any given point. Next, add the logic to halt the execution when the iteration goes above 100.īesides halting a program, debuggers show memory allocations. To do so, put a breakpoint on the for loop. The execution should stop when the iteration count reaches above 100. As an example, consider a for loop having 1,000 iterations. Secondly, one can also add logic to a breakpoint to halt the execution. One can add a breakpoint to pause execution. One can easily find bugs in software with a debugger. Debug node.js inside docker What is a Debugger?įor any developer, the debugger is the best friend.
