Build war with maven and DevOpsArea framework
Steps:
-
Clone the repository to your local machine
-
The Dockerfile will do.
A. Create maven container
--> copy pom.xml to /tmp
--> copy folder "src" to /tmp/src
--> Go to /tmp folder then run "mvn package"
--> The previos command will generate devopsarea-01.war
B. Create tomcat container
--> Will move the file devopsarea-01.war from maven container to /webapp in tomcat contaner
--> Do health check to make sure that the artifact is deployed -
Run 'docker build -t devopsarea .'
--> Will create a Docker image called devopsarea -
Run 'docker run -d -p 8080:8080 --name devopsarea-sample-java-app devopsarea'
--> Will create a container called devopsarea-sample-java-app and will forward the container internal port 8080 to locathost 8080 in the hosted machine -
Open http://localhost:8080/devopsarea-1.0/ in your browser