<p>I have a nodejs pod running in kubernetes production environment. Additionally there is staging and review environment in the same cluster running the same app. I recently added --inspect to the start command in the dockerfile which gets deployed to all environments.
My question is, if I enable debugging in production as well, will it impact performance or memory usage? Is it a good practice in general? Otherwise I'll need to create a separate dockerfile for production.</p>

<blockquote>
  <p>will it impact performance or memory usage?</p>
</blockquote>

<p>Both probably negligiable if just having the flag enabled, mileage may vary if actually live debugging.</p>

<blockquote>
  <p>Is it good practice</p>
</blockquote>

<p>I would say no, and it does have <a href="https://nodejs.org/de/docs/guides/debugging-getting-started/#security-implications" rel="nofollow noreferrer">security implications</a>. Although, this would only be a problem if you were to set a public IP, by default debugging would only be permitted on the localhost.</p>

<p>My.advice would be create a separate Dockerfile for prod.</p>
