Skip to content

emverdes/podman-tomcat-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Podman+Tomcat tutorial

A basic tutorial on running a web app on Tomcat using Podman (based on a docker tutorial)

Steps

  • 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
$ podman run -p 8009:8080 --name demo1 tomcat-demo:1

Simple apache reverse proxy

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"

Apache proxy loadbalancer for 2 containers

<Proxy "balancer://mycluster">
    BalancerMember "http://localhost:8008/sample"
    BalancerMember "http://localhost:8009/sample"
</Proxy>
ProxyPass        "/" "balancer://mycluster/"
ProxyPassReverse "/" "balancer://mycluster/"

For reverse proxy

  • #setsebool -P httpd_can_network_connect on
  • #setsebool -P httpd_can_network_relay on

Links

Sample Tomcat web app

About

A basic tutorial on running a web app on Tomcat using Podman

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Dockerfile 100.0%