title: Docker-compose: ERR_EMPTY_RESPONSE
body: <p>If I launch a Docker container by first creating the image and then running it (<code>docker build --rm -t myApp</code> + <code>docker run -p 80:80 -P -d myApp</code>), everything works fine.</p>
  
  <p>But, when I do the same with Docker-compose and access to localhost, the browser returns me a ERR_EMPTY_RESPONSE error (not the typical: "Connection refused").</p>
  
  <p>Where am I wrong?</p>
  
  <p>Docker-compose.yml:</p>
  
  <pre><code>version: '2'
  services:
   myApp:
    build: myApp
    ports:
     - "80:8000"
  </code></pre>
  
  <p>/myApp/Dockerfile:</p>
  
  <pre><code>FROM fedora-nodeJS
  ADD app.js /
  EXPOSE 8000
  CMD node app
  </code></pre>
  
  <p>/myApp/app.js:</p>
  
  <pre><code>var http  = require('http');
  
  var PORT  = 8000;
  var ADDR  = '0.0.0.0';
  
  http.createServer(function(req, res) {
      res.writeHead(301, { Location: 'http://stackoverflow.com' });
      res.end();
  }).listen(PORT,ADDR);
  </code></pre>
  
  <p><em>:: I know it makes no sense at all launch just one container with Docker-compose, but I had the same ERR_EMPTY_RESPONSE error when trying to launch several containers, so I ended up with this ridiculous scenario trying to understand whats failing.</em></p>