Hot-deploying Java Enterprise with WAD & Docker
I’ve recorded a video 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:
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 fast enough for my purposes:
Happy productive development!
Found the post useful? Subscribe to my newsletter for more free content, tips and tricks on IT & Java:
Success! Now check your email to confirm your subscription.
© Sebastian Daschner, CC BY-NC-SA 4.0
Published on Java Code Geeks with permission by Sebastian Daschner, partner at our JCG program. See the original article here: Hot-deploying Java Enterprise with WAD & Docker (Video)
Opinions expressed by Java Code Geeks contributors are their own.