![]() With the “Attach” config selected, click the “play” button to start the debugger. remoteRoot is set to the path of the code directory inside the container, because it’s almost certainly different than the path to the code on your machine.restart is set to true, so that the debugger re-attaches when the app restarts.The whole “Launch” config has been deleted – you’re using Compose to launch the app, not VSCode, so it’s unnecessary.Using your terminal, navigate to the directory with the app files and start up the app: Finally, it maps port 5858 inside the container to the same port on localhost, so you can connect to the remote debugger.It maps port 8000 inside the container to port 8000 on localhost, so you can actually visit the application.This is very useful, as it means you don’t have to rebuild the image every time you make a change to the application. This means that the code inside the running container will update whenever you update the local files on your hard drive. It overwrites the application code in the container by mounting the current directory as a volume. ![]() ![]() We do that here because when you ship this application’s container image to production, you don’t want the debugger enabled – it’s a development-only override. It overrides the command specified in the Dockerfile to enable the remote debugging feature built into Node.js.It defines a service called “web”, which uses the image built from the Dockerfile in the current directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |