title: Node.js app in a docker container not reachable over Internet "Connection refused"
body: <p>I am struggling for a quite some time making a node.js app to be accessible over Internet.
  The docker container is running on a port 9000.
  The host machine is an Oracle Linux virtual machine one, on the Oracle Cloud. I have enabled the port 9000 there.</p>
  <p>In the container I run the node.js app with:</p>
  <pre><code>sh-4.2# node index.js
  Starting application
  Initializing database module
  libDir = /usr/lib/oracle/19.3/client64/lib
  Initializing web server module
  Web server listening on Host:0.0.0.0, Port:9000
  </code></pre>
  <p>Check the docker container process from within the Oracle Linux host:
  docker ps</p>
  <pre><code>CONTAINER ID        IMAGE                          COMMAND             CREATED              STATUS              PORTS               NAMES
  8504964aa23c        227d64c853db/domaevid-server   &quot;sh&quot;                About a minute ago   Up About a minute   9000/tcp            mystifying_babbage
  </code></pre>
  <p>And testing the connection on the host is giving back the error:</p>
  <pre><code>[opc@instance-20210318-1902 ~]$ curl http://public.ip:9000/api/home
  curl: (7) Failed connect to public.ip:9000; Connection refused
  </code></pre>
  <p>The content of the Dockerfile:</p>
  <pre><code>FROM oraclelinux:7-slim
  
  WORKDIR /usr/src/app
  COPY package*.json ./
  
  RUN  yum -y install oracle-release-el7 &amp;&amp; \
      yum -y install oracle-instantclient19.3-basiclite &amp;&amp; \
      yum -y install oracle-nodejs-release-el7 &amp;&amp; \
      yum-config-manager --disable ol7_developer_EPEL &amp;&amp; \
      yum install vim-enhanced -y &amp;&amp; \ 
      yum -y install nodejs &amp;&amp; \
      npm install &amp;&amp; \
      rm -rf /var/cache/yum
  RUN echo &quot;export xxx&quot; &gt;&gt; ~/.bashrc &amp;&amp; \
      echo &quot;export xxx&quot; &gt;&gt; ~/.bashrc &amp;&amp; \
      echo &quot;export xxx&quot; &gt;&gt; ~/.bashrc &amp;&amp; \
      echo &quot;export xxx&quot; &gt;&gt; ~/.bashrc &amp;&amp; \
      echo &quot;export xxx&quot; &gt;&gt; ~/.bashrc
  RUN source ~/.bashrc 
  COPY /_docker/ORACLE/NETWORK/ADMIN/* /usr/lib/oracle/19.3/client64/lib/network/admin 
  
  COPY . .
  
  EXPOSE 9000
  CMD [ &quot;node&quot;, &quot;index.js&quot; ]
  </code></pre>
  <p>What else should be done so the node.js app is reachable over Internet?</p>
  <p>Kind regards,
  Dime</p>