Docker and CI/CD · Middle · Question 8 of 75
Why is CMD ["npm", "start"] discouraged in production images?
- 1npm is removed from official Node images after the build
- ✓Correct answer: npm may not forward signals to node, and it adds an extra process
- 3npm start runs the app in development mode by default
Explanation
Running node directly makes it the process that gets SIGTERM, so graceful shutdown works, and it avoids npm's overhead.