Docker and CI/CD · Middle · Question 8 of 75

Why is CMD ["npm", "start"] discouraged in production images?

Explanation

Running node directly makes it the process that gets SIGTERM, so graceful shutdown works, and it avoids npm's overhead.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 8

Test yourself

Take the Docker and CI/CD · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz