Here is my Dockerfile:
FROM tomcat:8.0-alpine
RUN rm -rf /Users/firstname.lastname/Desktop/Backup/apache-tomcat-9.0.30/webapps/*
ADD ./target/restfullapi-0.0.1-SNAPSHOT.war /Users/firstname.lastname/Desktop/Backup/apache-tomcat-9.0.30/webapps/restfullapi.war
EXPOSE 8089
CMD ["catalina.sh", "run"]
Once I build the .war file I do the following steps:
docker build -t restfullapi.war . docker run -d -p 8085:8089 restfullapi.war Now when I open localhost:8085 I am able to see only tomcat home page which is correct, but the problem is If I try to access -->> localhost:8085/restfullapi/movies I get 404 error.
and here is my pom.xml
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.dev.movies restfullapi war 0.0.1-SNAPSHOT RestFulAPI Maven Webapp http://maven.apache.org junit junit 3.8.1 test
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.2.3.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
</dependency>
</dependencies>
<build>
<finalName>restfullapi</finalName>
</build>