This repository contains a set of files and scripts to deploy a Java web application on a Tomcat server using Docker and Ansible. The application is comprised of several components:
- webapp: a Java Servlet application that serves a simple "Hello World" HTML page.
- server: a Java library that provides a simple greeting message.
The repository includes the following files:
Dockerfile
: defines the Docker image for the web application.pom.xml
: the Maven build file for the web application.regapp-deploy.yml
: an Ansible playbook file that deploys the web application on a Tomcat server using Docker.regapp-service.yml
: an Ansible playbook file that creates a LoadBalancer service for the web application.
- Clone the repository:
$ git clone https://github.com/SofiaNeogalaxy/deploy-artifacts-on-tomcat-server.git
- Build the Docker image:
$ cd deploy-artifacts-on-tomcat-server
$ docker build -t regapp:1.0 .
- Deploy the application to a Tomcat server using Ansible:
$ ansible-playbook regapp-deploy.yml
$ ansible-playbook regapp-service.yml
- Access the application in a web browser:
Note the IP address and port of the LoadBalancer service, and access the application at http://<ip>:<port>
.