How to deploy webapp or war file in tomcat that is running in docker container -


i have created docker container , tomcat running in container. how can deploy webapp or war file in tomcat running in docker container.

first create dockerfile:

from library/tomcat run rm -rf /usr/local/tomcat/webapps/* add ./relative/path_to_war.war /usr/local/tomcat/webapps/root.war 

then build docker image

$ docker build -t user/image_name . 

and run docker container.

$ docker run --name container_name -p 80:8080 -d user/image_name 

after webapp should responding on docker host's ip on default http 80 port.

you might need link database container webapp, see more on docker documentation


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -