title: Spring Boot war to docker
body: <p>my docker file looks like this: </p>
  
  <pre><code>FROM tomcat:8.5-alpine
  VOLUME /tmp
  COPY SNAPSHOT.war /usr/local/tomcat/webapps/app.war
  RUN sh -c 'touch /usr/local/tomcat/webapps/app.war'
  EXPOSE 8080
  ENTRYPOINT [ "sh", "-c", "java -Dspring.profiles.active=docker -Djava.security.egd=file:/dev/./urandom -jar /usr/local/tomcat/webapps/app.war" ]
  </code></pre>
  
  <p>Everything is ok when deploying it. I am using docker compose because I have 2 containers: one for tomcat and one for mongodb.</p>
  
  <p>docker-compose.yml looks like this:</p>
  
  <pre><code>tomcatserver:
      image: myimage
      container_name: tomcat
      ports:
          - 8080
      hostname: tomcat
      links:
          - mongodb:mongo
  
  mongodb:
      image: mongo
      container_name: mongo
      ports:
          - 27017
      hostname: mongo
      volumes:
          - $HOME/data/mongo:/data/db
      restart: always
  </code></pre>
  
  <p>So everything works fine except my static resources. They are located in </p>
  
  <blockquote>
    <p>/src/main/resources/META-INF/resources/</p>
  </blockquote>
  
  <p>When I compile it with </p>
  
  <blockquote>
    <p>./gradlew bootRun</p>
  </blockquote>
  
  <p>it works fine, I can access these static resources but when uploaded to docker they are inaccessible. </p>
  
  <p>Any suggestions?</p>