How do add --inspect=0.0.0.0:9229 when using nextjs running in a Docker. Currently in docker file the app is started
# Start the app
CMD ["npm", "start"]
in package.json:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
Where do I add --inspect=0.0.0.0:9229 so that I can take a memory dump snapshot.
You need to share port 9229 from your container, so don't forget to supply
-p 9229:9229when youdocker run.Option 1: Dockerfile
One option would be to put it into your
Dockerfile(see simplified version below):Option 2: Command Line
Alternatively you can supply the environment variable on the command line when you
docker runlike this: