This is the official Dropwizard-Sample written in Kotlin and built with Gradle.
I'm also using the Gradle Shadow plugin to create a self-contained executable Jar, which is then executed in a Docker container.
Clone the repo & ./gradlew shadowJar
.
Pre-Reqs: Docker, Docker-Compose.
Just docker-compose up -d
in the root project dir.
If you docker ps
you should be seeing a running container with the name dropwizard-sample
.
You can either manually run the artifact by java -jar build/libs/dropwizard-sample.jar server sample.yml
in the project root or just use ./gradlew run
which does the heavy-lifting for you.
Just go ahead and check http://localhost:8080/api/hello-world?name=GitHub after doing either of the getting started parts.