Skip to content

Pet Clinic API with Quarkus and Hibernate (Panache), Flyway, RESTEasy (+Jackson), Swagger, PostgreSQL

Notifications You must be signed in to change notification settings

szymjaw/quarkus-petclinic-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quarkus Pet Clinic API

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn how to build PetClinic REST API with Quarkus, please visit: https://blog.codeleak.pl/2020/02/getting-started-with-quarkus.html.

Developing the application

  • Run development database locally with Docker:
docker run -it --name petclinic-dev -p 5433:5432 -e POSTGRES_DB=petclinic-dev -e POSTGRES_USER=petclinic-dev -e POSTGRES_PASSWORD=petclinic-dev -d postgres:11.6-alpine
  • Run your application in dev mode that enables live coding using:
./mvnw quarkus:dev

Packaging and running the application

  • Run database locally with Docker:
docker run -it --name petclinic-db -p 5432:5432 -e POSTGRES_DB=petclinic -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -d postgres:11.6-alpine
  • Package the application:
./mvnw package

It produces the executable quarkus-petclinic-api-1.0.1-runner.jar file in /target directory with dependencies copied into the target/lib directory.

The application is now runnable using java -jar target/quarkus-petclinic-api-1.0.1-runner.jar.

  • Create uber-jar:
./mvnw clean package -Dquarkus.package.uber-jar=true

Creating distribution for AWS Elastic Beanstalk

  • Create distribution (zip) for AWS Elastic Beanstalk:
./mvnw clean package assembly:single -Dquarkus.package.uber-jar=true

This will create zip package with the uber-jar, Dockerfile and config/application.properties.

  • Upload quarkus-petclinic-api-1.0.1-eb.zip to AWS Elastic Beanstalk.

Learn how to launch single container Docker environment with Quarkus based application on Elastic Beanstalk: https://blog.codeleak.pl/2020/03/deploy-quarkus-application-to-elastic-beanstalk.html

Creating a native executable

You can create a native executable using: ./mvnw package -Pnative.

Or you can use Docker to build the native executable using: ./mvnw package -Pnative -Dquarkus.native.container-build=true.

You can then execute your binary: ./target/quarkus-petclinic-api-1.0.1-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image-guide .

About

Pet Clinic API with Quarkus and Hibernate (Panache), Flyway, RESTEasy (+Jackson), Swagger, PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 78.0%
  • TSQL 14.2%
  • HTML 7.8%