title: docker-compose up fails for npm
body: <p>I am facing below exception while running <code>docker-compose up</code> command:</p>
  <pre class="lang-none prettyprint-override"><code>Creating compose_node-app_1 ... done
  Attaching to compose_node-app_1
  node-app_1  | 
  node-app_1  | &gt; start
  node-app_1  | &gt; node index.js
  node-app_1  | 
  node-app_1  | /usr/app/node_modules/assert-options/dist/src/index.js:16
  node-app_1  |                 throw new Error('Option &quot;' + a + '&quot; is not recognized.');
  node-app_1  |                 ^
  node-app_1  | 
  node-app_1  | Error: Option &quot;host&quot; is not recognized.
  node-app_1  |     at assertOptions (/usr/app/node_modules/assert-options/dist/src/index.js:16:23)
  node-app_1  |     at $main (/usr/app/node_modules/pg-promise/lib/main.js:194:15)
  node-app_1  |     at Object.&lt;anonymous&gt; (/usr/app/index.js:13:12)
  node-app_1  |     at Module._compile (node:internal/modules/cjs/loader:1108:14)
  node-app_1  |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
  node-app_1  |     at Module.load (node:internal/modules/cjs/loader:973:32)
  node-app_1  |     at Function.Module._load (node:internal/modules/cjs/loader:813:14)
  node-app_1  |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
  node-app_1  |     at node:internal/main/run_main_module:17:47
  node-app_1  | npm ERR! code 1
  node-app_1  | npm ERR! path /usr/app
  node-app_1  | npm ERR! command failed
  node-app_1  | npm ERR! command sh -c node index.js
  node-app_1  | 
  node-app_1  | npm ERR! A complete log of this run can be found in:
  node-app_1  | npm ERR!     /root/.npm/_logs/2021-01-21T15_49_47_966Z-debug.log
  </code></pre>
  <p>Below is what I have in different files:</p>
  <p><strong>docker-compose.yml</strong></p>
  <pre class="lang-yml prettyprint-override"><code>version: '3.4'
  services:
          # postgres-server:
          #         network_mode: host
          #         image: postgres
          #         restart: always
          #         environment:
          #                 POSTGRES_PASSWORD: example
          # adminer:
          #         network_mode: host
          #         image: adminer
          #         restart: always
          #         ports:
          #                 - '8080:8080'
          node-app:
                  restart: on-failure
                  build: .
                  ports:
                          - '8089:8089'
  </code></pre>
  <p><strong>index.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>const express = require('express');
  const app = express();
  const hostname = '127.0.0.1';
  app.get('/', (req, res)=&gt; {
  
    res.send('Welcome to K8s session')
  });
  app.listen(8089, hostname, ()=&gt;{
    console.log('Listening to port 8080')
  });
  </code></pre>
  <p><strong>package.json</strong></p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;dependencies&quot;:{
      &quot;express&quot;:&quot;*&quot;
    },
    &quot;scripts&quot;:{
      &quot;start&quot;: &quot;node index.js&quot;
    }
  }
  </code></pre>
  <p><strong>Dockerfile</strong></p>
  <pre class="lang-none prettyprint-override"><code>FROM node:alpine
  
  WORKDIR /usr/app
  COPY . .
  RUN npm install --global
  COPY ./package.json .
  
  CMD [&quot;npm&quot;, &quot;start&quot;]
  </code></pre>
  <p>If I normally use docker commands to build and run this container then able to do so.. but I am trying via docker-compose because would want to extend to use db.. could someone please suggest what is this host exception and how can we troubleshoot?</p>
  <p>Thanks</p>