DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Hot-Deploying Java Enterprise With WAD and Docker [Video]

Hot-Deploying Java Enterprise With WAD and Docker [Video]

Minimize development turnaround times with WAD.

Sebastian Daschner user avatar by
Sebastian Daschner
·
Apr. 24, 19 · Tutorial
Like (1)
Save
Tweet
Share
9.98K Views

Join the DZone community and get the full member experience.

Join For Free

I’ve recorded a video on how to minimize the development turnaround times with Watch and Deploy (WAD) by Adam Bien and Docker containers. The WAD tool watches for file changes and will re-build and re-deploy our applications to an auto-deployment directory. We’ll see how that approach can be integrated into containers that are created by the same Docker images that run in production.


Besides the news around the fast turnaround with Quarkus, which is a very interesting project, it’s possible to have a good development experience solely with Java EE and application servers that deploy quickly. The WAD tool watches for any changes that we make in the project and re-deploys our applications. If you run your application in Docker containers, you can and, in fact, should use the same Docker image locally that you will later run in production.

For our purposes, we’ll mount the auto-deployment directory into the local Docker container. WAD will watch our project directory and hot-update the deployment artifact accordingly.

You could automate the Docker images creation, container start, and WAD invocation similar to the following:

#!/bin/bash

docker build -t test-project:1 .
docker stop test-project || true

docker run -d --rm \
  --name test-project \
  -p 9080:9080 \
  -v /tmp/wad-dropins/:/opt/wlp/usr/servers/defaultServer/dropins/ \
  test-project:1

java -jar <path-to-wad>/wad.jar /tmp/wad-dropins/


If you then change code files in your application, WAD will re-build your application, copy the artifact to the directory, which is mapped into the container, and your application server re-deploys the app.

In my video, I use Open Liberty, which is fast enough for my purposes:

...
[AUDIT]: The application test-project has stopped successfully.
[AUDIT]: Web application available (default_host) http://44ae8449d5eb:9080/test-project/
[AUDIT]: The application test-project updated in 0.685 seconds.


Happy productive development!

Docker (software) Java (programming language)

Published at DZone with permission of Sebastian Daschner. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Kotlin Is More Fun Than Java And This Is a Big Deal
  • Hackerman [Comic]
  • The Real Democratization of AI, and Why It Has to Be Closely Monitored
  • A Simple Union Between .NET Core and Python

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: