Skip to content

zghanem0/dep-Java-docker-ansible

Repository files navigation

DevOpsArea Sample Java App -example

Build war with maven and ghanem-app framework

Steps are the following:

  1. Clone the repository to your local machine

  2. 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
  3. Run 'docker build -t ghanem-app .'

    • Will create a Docker image called devopsarea
  4. 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
  5. Open http://localhost:8080/ghanem-app-1.2/ in your browser and see the result.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published