This code base has the code to run a spring boot application in a Java 11 environment.
./gradlew clean build
java -jar -Dspring.profiles.active=prod build/libs/item-service-springboot-java11-0.0.1-SNAPSHOT.jar
- There are two files which takes care of the whole docker process.
- Dockerfile
- docker-entrypoint.sh
-
The Docker build options are explained here.
-t -> Providing a tag name for the docker image. -
The below command creates a docker image with name item-service and the tag is 1.0.
docker build -t item-service:1.0 .
docker run -p 8090:8080 -t item-service:1.0
curl http://localhost:8090/v1/greeting
curl http://localhost:8090/v1/items