Build war with maven and ghanem-app framework
Steps are the following:
-
Clone the repository to your local machine
-
The Dockerfile will do:
A. Create maven container <br />
- copy pom.xml to /tmp
- copy folder "src" to /tmp/src
- Go to /tmp folder then run "mvn package"
The previos command will generate ghanem-app-1.2.war
B. Create tomcat container<br />
- Will move the file ghanem-app-1.2.war from maven container to /webapp in tomcat contaner
- Do health check to make sure that the artifact is deployed
- copy pom.xml to /tmp
-
Run 'docker build -t ghanem-app .'
- Will create a Docker image called devopsarea
- Will create a Docker image called devopsarea
-
Run 'docker run -d -p 8080:8080 --name ghanem-app-1.2.war -sample-java-app ghanem-app '
- 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/ghanem-app-1.2/ in your browser and see the result.