Docker Community Forums

Share and learn in the Docker community.

Can i be able to have two web apps in a tomcat by using docker


(Prabakar) #1

I have used docker but don’t no how to have two web apps by using tomcat. So kindly tell me is there a possible way to do ? and if there is a possibility can u give me suggestion how to use the web apps in tomcat


(Sven Dowideit) #2

I don’t do Java development, so I haven’t tried this, but from the ‘using tomcat in Docker containers’, it sounds to me like you can place many war files into the /var/lib/tomcat7/webapps dir, and it’ll work.

I’d probably make a Dockerfile that starts with FROM tomcat, and then have it add the war files - and then run that new image, but you could also use volumes to add them.

mmm, though it seems to me that the official image ( https://registry.hub.docker.com/_/tomcat/ ) might have a different directory layout - i think that means you put the war files into the $CATALINA_HOME/webapps dir.


(Winniwinter) #3

That’s right. There is no docker limitations. Just put your WAR into the <catalina_base>/webapps directory.
If you have the host-manager installed and forwarded your tomcat port to your host you can also do it within your browser. Just open http://:8080/manager/html . You’ll see the list of deployed apps.


(Prabakar) #4

Can you help me with a sample war file for tomcat ?