An example Dropwizard application to demonstrate how to use Dropwizard using JDBI to interact with postgresql (or any db).
Before start the application, you need to create database.
To setup the postgresql database, run the following:
docker run -p 5432:5432 -e POSTGRES_PASSWORD=password postgres
then create the database by running:
java -jar target/dropwizard-games-1.0.0.jar db migrate teams-local-conf.yml
Now you can start the application.
- Run
mvn clean install
to build your application - Start application with
java -jar target/dropwizard-games-1.0.0.jar server teams-local-conf.yml
- To check that your application is running enter url
http://localhost:8080
To see your applications health enter url http://localhost:8081/healthcheck
To run application with docker compose, run following in the root directory where docker-compose.yml file exists
docker-compose up
To stop and remove the the containers run following
docker-compose down