docker: cannot map two container ports to one host port
<p>app.json for pm2 (src/app.py is Flask app):</p>

<pre><code>{
    "apps": [
    {
      "exec_mode": "fork",
      "script": "src/app.py",
      "args": ["-p", "8080"]
    },
    {
      "exec_mode": "fork",
      "script": "src/app.py",
      "args": ["-p", "8081"]
    }
  ]
}
~        
</code></pre>

<p>Dockerfile:</p>

<pre><code>EXPOSE 8080 8081
CMD ["pm2", "start", "app.json"]
</code></pre>

<p>Error when running docker:</p>

<pre><code>docker run -p 8080:8080 -p 8080:8081 oct20
docker: Error response from daemon: driver failed programming external connectivity on endpoint high_fermi (xxxxxxxxxxx): Bind for 0.0.0.0:8080 failed: port is already allocated.
</code></pre>

<p>Any ideas? Thanks</p>