title: Deploy Tomcat/Docker Hello-World to Heroku returning HTTP:503
body: <p>I admit I am somewhat in the weeds w/r/t managing port configs with this little app that lives inside a Tomcat container.</p>
  <p>I know TC listens on 8080.  I assume that, as long as whatever port Heroku comes up with is mapped to 8080 in the container, the request should reach the container at least.  I have tried to follow their instructions accordingly.  Have no idea why webapp-runner is needed but Heroku specifies it.</p>
  <p>However, when developing locally (where it works fine), the name of the target war is specified in the request (ie <a href="http://127.0.0.1:8080/DockerJavaWebApp-1.0-SNAPSHOT/" rel="nofollow noreferrer">http://127.0.0.1:8080/DockerJavaWebApp-1.0-SNAPSHOT/</a>).  I'm not sure how to do that, or if it's necessary, in the deployment.  And I'd rather not have to do it locally, either.</p>
  <p>Any assistance appreciated with thanks in advance.</p>
  <p><strong>Dockerfile:</strong></p>
  <pre><code>FROM tomcat
  ADD target/DockerJavaWebApp-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/
  EXPOSE 8080
  CMD [&quot;catalina.sh&quot;, &quot;run&quot; , &quot;-b&quot;, &quot;0.0.0.0:$PORT&quot;]
  </code></pre>
  <p><strong>docker-compose:</strong></p>
  <pre><code>version: '3'
  
  services:
    app:
      build: .
      image: yermammy #tomcat_test
      environment:
        - PORT
  </code></pre>
  <p><strong>Procfile:</strong></p>
  <pre><code>web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war
  </code></pre>
  <p><strong>heroku logs (elided):</strong>
  (does that port mapping look like it has the right syntax?)</p>
  <pre><code>2021-05-25T00:39:16.515638+00:00 heroku[web.1]: Starting process with command `catalina.sh run -b 0.0.0.0:\48915`
  
  2021-05-24T18:04:27.398894+00:00 app[web.1]: 24-May-2021 18:04:27.398 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [6388] milliseconds
  
  2021-05-24T18:05:07.025452+00:00 heroku[router]: at=error code=H20 desc=&quot;App boot timeout&quot; method=GET path=&quot;/&quot; host=blah-tomcat-test.herokuapp.com request_id=0b87e97e-ca2f-4406-b4f2-329890f923db fwd=&quot;65.35.200.119&quot; dyno= connect= service= status=503 bytes= protocol=https
  
  2021-05-24T18:05:07.725522+00:00 heroku[web.1]: Error R10 (Boot timeout) -&gt; Web process failed to bind to $PORT within 60 seconds of launch
  
  2021-05-24T18:05:07.785462+00:00 heroku[web.1]: Stopping process with SIGKILL
  
  2021-05-24T18:05:08.146910+00:00 heroku[web.1]: Process exited with status 137
  2021-05-24T18:05:08.219013+00:00 heroku[web.1]: State changed from starting to crashed
  
  2021-05-24T18:05:10.482493+00:00 heroku[router]: at=error code=H10 desc=&quot;App crashed&quot; method=GET path=&quot;/&quot; host=blah-tomcat-test.herokuapp.com request_id=d328a542-0466-4be5-9a82-1eda0cb42af4 fwd=&quot;65.35.200.119&quot; dyno= connect= service= status=503 bytes= protocol=https
  
  2021-05-24T18:05:12.259286+00:00 heroku[router]: at=error code=H10 desc=&quot;App crashed&quot; method=GET path=&quot;/favicon.ico&quot; host=blah-tomcat-test.herokuapp.com request_id=c2172b8c-4a66-491d-9db1-86685a4f6662 fwd=&quot;65.35.200.119&quot; dyno= connect= service= status=503 bytes= protocol=https
  
  2021-05-24T18:05:27.529565+00:00 heroku[router]: at=error code=H10 desc=&quot;App crashed&quot; method=GET path=&quot;/index.jsp&quot; host=blah-tomcat-test.herokuapp.com request_id=38a21675-c542-46a1-8692-1672547b6f02 fwd=&quot;65.35.200.119&quot; dyno= connect= service= status=503 bytes= protocol=https
  
  2021-05-24T18:05:27.951191+00:00 heroku[router]: at=error code=H10 desc=&quot;App crashed&quot; method=GET path=&quot;/favicon.ico&quot; host=blah-tomcat-test.herokuapp.com request_id=7cba1f7a-abdf-43c0-bba7-dd7341e4daee fwd=&quot;65.35.200.119&quot; dyno= connect= service= status=503 bytes= protocol=https
  </code></pre>