oabai / java-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DevOpsArea Sample Java App -example

Build war with maven and DevOpsArea 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 devopsarea-01.war

     B. Create tomcat container<br />
    
    • 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
  3. Run 'docker build -t devopsarea .'

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

About


Languages

Language:Dockerfile 52.5%Language:Java 47.5%