GithubHelp home page GithubHelp logo

jeperez / petclinic-docker-jrebel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antonarhipov/petclinic-docker-jrebel

0.0 2.0 0.0 33.46 MB

A demonstration of JRebel for updating the Java application running in a Docker container

Batchfile 0.20% Shell 0.19% Java 94.21% CSS 5.39%

petclinic-docker-jrebel's Introduction

Spring PetClinic Sample Application

This repo is a fork of the spring-petclinic/spring-framework-petclinic. The intent of the repository is to demonstrate, how to use JRebel to hot reload Java classes in a web application that is started in a Docker container.

The extra artifacts that are added compared to the original repositories:

  • jrebel/ -- JRebel standalone distribution
  • docker-compose.yml -- Docker Compose configuration that describes all the dependencies and configuration to start the application in the Docker container
  • src/main/resources/rebel-remote.xml -- A configuration file for JRebel Remoting to recognize the module as "reloadable"

docker-compose.yml

The configuration file describes the environment and dependencies that are required for this example.

petclinic:
  image: tomcat:8.0
  ports:
    - "8080:8080"
  volumes:
    - "./jrebel/jrebel.jar:/jrebel.jar"
    - "./jrebel/lib/libjrebel64.so:/libjrebel64.so"
    - "./target/petclinic.war:/usr/local/tomcat/webapps/petclinic.war"
    - "~/.jrebel:/.jrebel"
 environment:
    - "JAVA_OPTS=-agentpath:/libjrebel64.so -Drebel.remoting_plugin=true"

The configuration uses Tomcat Docker image, hence the web archive of the application should be mapped to /usr/local/tomcat/webapps/ folder. The binaries from JRebel distribution -- jrebel.jar and libjrebel64.so -- are required for the agent to work. The local .jrebel is optional, but suggested to persist JRebel caches in order to make the application startup faster in case of restarts.

For more imformation about JRebel Remoting see the official documentation: https://manuals.zeroturnaround.com/jrebel/remoteserver/index.html

Running the application

!!!Before you start - make sure that Docker is installed on your machine!!!

      git clone --depth 1 https://github.com/antonarhipov/petclinic-docker-jrebel.git
      cd petclinic-docker-jrebel
      ./mvnw -DskipTests clean package
      docker-compose up

To start updating the application:

  • Import the Maven project into your IDE of choice
  • Generate rebel.xml configuration file
  • Configure the remote server URL in JRebel settings. In this case, the URL is http://localhost:8080. (The IDE plugin will show a warning -- safely ignore)
  • Make changes to the source code and synchronize the project via JRebel IDE plugin

petclinic-docker-jrebel's People

Contributors

antonarhipov avatar arey avatar babinslava avatar boly38 avatar bram-atmire avatar cbeams avatar colinbut avatar craigsdennis avatar cyrille-leclerc avatar freemansoft avatar gordonad avatar helloworld123122344134 avatar liouxiao avatar lukasz-szewc avatar meltsufin avatar mklose avatar patrickcrocker avatar rstoyanchev avatar srenkens avatar tduchateau avatar tejasm avatar thinkshihang avatar trepel avatar verydapeng avatar vfedoriv avatar vladfau avatar

Watchers

 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.