Containerize a Dropwizard application with Jib
- Run
./mvnw clean package
to build your container - Start the application
- With Docker:
docker run --rm -p 8080:8080 dropwizard-jib-example:1
- Without Docker:
./mvnw exec:java
- With Docker:
- Check that your application is running at http://localhost:8080
See your application's health at http://localhost:8080/admin/healthcheck
FreeMaker templating is setup for dropwizard.yml
through tkrille/dropwizard-template-config
; this allows one to heavily customize the properties file via the container environment with FTL conditional checks and for loops, for example.
Starter Maven template generated with dropwizard-archetypes
mvn archetype:generate \
-DarchetypeGroupId=io.dropwizard.archetypes \
-DarchetypeArtifactId=example \
-DarchetypeVersion=[REPLACE ME WITH A VALID DROPWIZARD VERSION]
Ref. Dropwizard - Getting Started, Setting up With Maven
The remainder of the archetype code was filled-in following the above guide.
Learn more about Jib.
Learn more about Dropwizard.