A basic tutorial on running a web app on Tomcat using Podman (based on a docker tutorial)
- Install podman.
- Clone this repository
$ git clone https://github.com/emverdes/docker-tomcat-tutorial.git
$ cd docker-tomcat-tutorial
Build the image
$ podman build -t tomcat-demo:1 .
Run the image
$ podman run -p 8008:8080 --name demo1 tomcat-demo:1
- In your browser go to http://localhost:8008
- Run another instance for load balancing
$ podman run -p 8009:8080 --name demo1 tomcat-demo:1
Add to a VirtualHost in your apache web server configuration. Replace localhost with the hostname of the host running your containers. Remember to open up the ports in your firewall if needed.
ProxyPass "/sample" "http://localhost:8008/sample"
ProxyPassReverse "/sample" "http://localhost:8008/sample"
<Proxy "balancer://mycluster">
BalancerMember "http://localhost:8008/sample"
BalancerMember "http://localhost:8009/sample"
</Proxy>
ProxyPass "/" "balancer://mycluster/"
ProxyPassReverse "/" "balancer://mycluster/"
- #setsebool -P httpd_can_network_connect on
- #setsebool -P httpd_can_network_relay on