title: node.js + pm2 -- Configuring node_args depending on environment
body: <p>Below is a very simple <code>process.json</code> to launch a <code>js</code> app with pm2. </p>
  
  <p>My goal is to have the process kick off the below <code>node_args</code> but only for <strong>non-prod launches</strong>. So, for example, if a certain environment variable is set a certain way, then trigger the node_args, otherwise ignore them. </p>
  
  <p>Is this possible? If not, any workarounds I can do?</p>
  
  <pre><code>{
    apps : [
      {
        name      : 'API',
        script    : './app.js',
        node_args: ["--inspect","--debug=0.0.0.0:7000"],
        env: {
          NODE_ENV: 'development'
        }
      }
    ]
  }
  </code></pre>
  
  <p>I know that it's possible to throw <code>node_args</code> at the command line, however the goal is to run this in docker where the "run" command is static to the source image so that's not really viable. </p>
  
  <p>Here is the <code>CMD</code> entry in my Dockerfile: </p>
  
  <p><code>CMD [ "pm2-docker", "--auto-exit", "--watch", "process.json"]</code></p>