$ git clone https://github.com/smaddala/brewery.git .
$ docker build -t brewery .
This will first run maven build to create jar package and then build brewery image using built jar package.
$ docker run -p 8080:8080 -it --rm brewery
$ curl localhost:8080/api/v1/beer
the response should be:
{
"beerName": "my beer",
"beerStyle": "LAGER",
"upc": 89797,
"price": 10.00,
"quantityOnHand": null,
"createdDate": null,
"lastModifiedDate": null,
"version": null
}
Build and start the container by running
$ docker-compose up -d
$ curl localhost:8080/api/v1/beer
the respone should be:
{
"beerName": "my beer",
"beerStyle": "LAGER",
"upc": 89797,
"price": 10.00,
"quantityOnHand": null,
"createdDate": null,
"lastModifiedDate": null,
"version": null
}
docker-compose down