title: After deployment of WAR to tomcat docker container always getting 404
body: <p>I have a grails app, that already runs and was deployed to AWS through Elastic Beanstalk on Tomcat8 Jre8.</p>
  
  <p>I am now trying to deploy it on multi-docker environment and I have quite weird behavior.</p>
  
  <p>I am using <code>tomcat:8.0-jre8</code> (<a href="https://hub.docker.com/r/library/tomcat/" rel="noreferrer">https://hub.docker.com/r/library/tomcat/</a>) as an image for container, and the deployment on that image is pretty simple, by putting a war file in <code>&lt;tomcat_home&gt;/webapps</code>. Also, I am mapping port <code>8080</code> to the outside world. So, related portion of docker-compose look like this:</p>
  
  <pre><code>api:
    image: tomcat:8.0-jre8
    container_name: api
    volumes:
      - ./deployment/api:/usr/local/tomcat/webapps
    external_links:
      - mysql:mysql
    ports:
      - "8080:8080"
  </code></pre>
  
  <p>Based on the logs, the app is getting deployed successfully, and even liquibase migrations are getting applied:</p>
  
  <pre><code>21-Nov-2016 07:11:03.671 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /usr/local/tomcat/webapps/priz-0.5.war
  21-Nov-2016 07:12:12.496 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  2016-11-21T07:13:38.397268676Z 
  Configuring Spring Security Core ...
  ... finished configuring Spring Security Core
  2016-11-21T07:13:40.215275700Z 
  2016-11-21T07:13:40.777432843Z 
  Configuring Spring Security REST 2.0.0.M2...
  ... finished configuring Spring Security REST
  2016-11-21T07:13:41.515464956Z 
  INFO 11/21/16 7:14 AM: liquibase: Successfully acquired change log lock
  INFO 11/21/16 7:14 AM: liquibase: Reading from priz.DATABASECHANGELOG
  INFO 11/21/16 7:14 AM: liquibase: Successfully released change log lock
  21-Nov-2016 07:15:09.019 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /usr/local/tomcat/webapps/priz-0.5.war has finished in 245,345 ms
  21-Nov-2016 07:15:09.026 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
  21-Nov-2016 07:15:09.036 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
  21-Nov-2016 07:15:09.038 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 245425 ms
  </code></pre>
  
  <p>However, when I am trying to access ANY one of the existing endpoints, I am getting 404 back.</p>
  
  <p>Now, also based on the logs, the request is actually hitting the server:</p>
  
  <pre><code>==&gt; ./logs/localhost_access_log.2016-11-21.txt &lt;==
  172.17.0.1 - - [21/Nov/2016:07:15:09 +0000] "GET / HTTP/1.1" 404 -
  172.17.0.1 - - [21/Nov/2016:07:15:09 +0000] "GET / HTTP/1.1" 404 -
  172.17.0.1 - - [21/Nov/2016:07:16:45 +0000] "GET / HTTP/1.1" 404 -
  172.17.0.1 - - [21/Nov/2016:07:17:01 +0000] "GET / HTTP/1.1" 404 -
  172.17.0.1 - - [21/Nov/2016:07:17:07 +0000] "GET /index HTTP/1.1" 404 -
  172.17.0.1 - - [21/Nov/2016:07:28:24 +0000] "GET /api/user/register HTTP/1.1" 404 -
  172.17.0.1 - - [21/Nov/2016:07:28:46 +0000] "POST /api/user/register HTTP/1.1" 404 -
  </code></pre>
  
  <p>How do I even approach this problem how to debug it? What am I missing? 
  There is nothing special in the logs.</p>
  
  <p>Also, I tried different versions of tomcat, including the exact one that runs on AWS EBS. 
  Also, tried proxing the request through nginx, same result.</p>