I want to deploy my web app to tomcat which running on docker. I have a directory "test" and it has two files:
-docker.compose.yml
-sample.war
(I download it from here https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/
)
Here is my docker-compose.yml content:
my-test:
image: tomcat
ports:
- "8080:8080"
volumes:
- ./hello.war:/usr/local/tomcat/webapps/hello.war
I am running docker-compose up
in "test" directory.
Then I am taking this : http://paste.ubuntu.com/23108774/
docker ps
output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
49bf16c1f366 tomcat "catalina.sh run" 12 minutes ago Up 17 seconds 0.0.0.0:8080->8080/tcp test_my-test_1
I am going to localhost:8080
then I see only Tomcat Home page.
But when I go localhost:8080/sample
HTTP Status 404 - /sample
type Status report
message /sample
description The requested resource is not available.
Apache Tomcat/8.0.36
I didnt understand why my web app is not running on localhost:8080/sample. where I am wrong?
docker version :1.12.1 OS:ubuntu 16.04
Thanks in advance.