title: "Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch" on node.js deploy with Docker in Heroku
body: <p>I'm trying to deploy an app to Heroku which was dockernized.
  This is my Dockerfile:</p>
  
  <pre><code>FROM node:4.2.2
  
  WORKDIR /usr/src
  RUN git clone https://github.com/***.git
  
  WORKDIR /usr/src/application
  
  RUN ./install.sh
  
  EXPOSE 80 3000
  CMD bash -C '/usr/src/application/start.sh'
  </code></pre>
  
  <p>Also, I have a Profile with just one line as follow:</p>
  
  <pre><code>web: node bin/www
  </code></pre>
  
  <p>Following the steps on the documentation, I've pushed the image via two commands:
  <code>heroku container:push web --app immense-falls-39679</code> and released with
   <code>heroku container:release web --app immense-falls-39679</code>.</p>
  
  <p>In the logs, everything seems to be going ok, with the app deployed successfully. But when it is about to start (with the <code>start.sh</code> script) it crashes with the error</p>
  
  <pre><code>2018-10-23T20:47:44.025502+00:00 app[web.1]: [20:47:44] Finished 'build-app' after 7.11 s
  2018-10-23T20:47:44.025958+00:00 app[web.1]: [20:47:44] Starting 'bundle-release'...
  2018-10-23T20:48:07.932228+00:00 heroku[web.1]: Error R10 (Boot timeout) -&gt; Web process failed to bind to $PORT within 60 seconds of launch
  2018-10-23T20:48:07.932327+00:00 heroku[web.1]: Stopping process with SIGKILL
  2018-10-23T20:48:08.058850+00:00 heroku[web.1]: Process exited with status 137
  2018-10-23T20:48:08.097770+00:00 heroku[web.1]: State changed from starting to crashed
  </code></pre>
  
  <p>I've researched and most have said that this is due to fixed setting the PORT value. But, in my <code>bin/www</code> (where is my server configs), I've already set the port to be either a fixed value or from the process.env</p>
  
  <pre><code>var app = require('../out/app');
  var debug = require('debug')('server:server');
  var http = require('http');
  
  /**
   * Get port from environment and store in Express.
   */
  
  app.set('port', (process.env.PORT || 3000));
  
  /**
   * Create HTTP server.
   */
  
  var server = http.createServer(app);
  
  /**
   * Listen on provided port, on all network interfaces.
   */
  
  server.listen(app.get('port'), function() {
    listenForNotificationRequests();
  });
  server.on('error', onError);
  server.on('listening', onListening);
  </code></pre>
  
  <p>I dont have any other clues on how fixing it. I would really appreciate any help. Thanks in advance</p>