Git Product home page Git Product logo

java-app's Introduction

Sample Java App -example

Big Note

#the artifact-id, group-id and version all those have no effect on the the artifacts, just the name #so the based on the name of the app you use it in the browser if the app in pom.xml "java-app-1.0" and in /var/lib//webapps/ is ghanem.war, to access the app u must write : localhost:8080/ghanem , if u want to use the root path remove the ROOT.war and just change the ghanem.war to ROOT.war

to Build war with maven and java-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 java-app.war

     B. Create tomcat container<br />
    
    • Will move the file java-app from maven container to /webapp in tomcat contaner
    • Do health check to make sure that the artifact is deployed
  3. Run 'docker build -t java-app .'

    • Will create a Docker image called java
  4. Run 'docker run -d -p 8080:8080 --name java-app java-app'

    • Will create a container called java-app and will forward the container internal port 8080 to locathost 8080 in the hosted machine
  5. Open [http://localhost:8080/ (http://localhost:8080/ in your browser and see the result.

Note : if you will use ansible you could do the following command (Run command as user Ansible )

sudo runuser -l ansible -c 'ansible-playbook deploy-playbook.yml'

java-app's People

Contributors

zghanem0 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.