---
title: "Comment by Adam Brodziak on \"Understanding a Dockerfile for a Node.js Application Step by Step\" | Hashnode"
description: "I&#39;d suggest to avoid npm run in the CMD line. NPM does not pass OS signals like SIGTERM to the Node application. It could cause a data loss for example. Exp"
url: "https://hashnode.com/posts/understanding-a-dockerfile-for-a-nodejs-application-step-by-step/64805f037b171fc421e8fe5f/comment/64844b5760eb3861916f0265"
---

[Discussion](https://hashnode.com/posts/understanding-a-dockerfile-for-a-nodejs-application-step-by-step/64805f037b171fc421e8fe5f)

Comment [Understanding a Dockerfile for a Node.js Application Step by Step](https://hashnode.com/posts/understanding-a-dockerfile-for-a-nodejs-application-step-by-step/64805f037b171fc421e8fe5f)

[Adam Brodziak](https://hashnode.com/@adambro)

[Jun 10, 2023](https://hashnode.com/posts/understanding-a-dockerfile-for-a-nodejs-application-step-by-step/64805f037b171fc421e8fe5f/comment/64844b5760eb3861916f0265)

I'd suggest to avoid `npm run` in the CMD line. NPM does not pass OS signals like SIGTERM to the Node application. It could cause a data loss for example. Explanation with sample source code in my blog post [adambrodziak.pl/dockerfile-good-practices-for-nod…](https://adambrodziak.pl/dockerfile-good-practices-for-node-and-npm)
