1

What is the command of the running node server in docker using DEBUG? I tried following commands in dockerfile but no luck.

CMD [ "npm", "DEBUG=* start" ]

CMD [ "DEBUG=*", "npm", "start" ]

I am using debug npm for logging.

Could you please help me?

1
  • Set the DEBUG environment car with ENV Commented Dec 26, 2018 at 12:45

1 Answer 1

1

According to documentation on npm debug, it requires DEBUG to be an environment variable, like set DEBUG=*,-not_this. In this case you can do it in several ways:

Using ENV command of Dockerfile:

ENV DEBUG * start

or

ENV DEBUG="* start"

If you want to dynamically change the DEBUG variable, you can put it into CMD and override on container start, but in this case you have to follow your OS rules for environment variable definition. For Windows it can be:

CMD ["cmd.exe", "-c", "set DEBUG=* start"]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.