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

Why install only production dependencies in the final image?

Explanation

npm ci --omit=dev in the runtime stage (or copying a pruned node_modules from a builder) keeps TypeScript, test runners and linters out of production.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 26

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