jfblg / ocn-java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enterprise Coffee

This is the coffee shop example project.

It comprises two applications, coffee-shop and barista, built using Java EE and Eclipse MicroProfile.

Building

To build the coffee-shop application, run the following:

cd coffee-shop/
mvn clean package
docker build -t coffee-shop:1 .

Then, to build the barista application, run the following:

cd ../barista/
mvn clean package
docker build -t barista:1 .

Running

Docker network

To ensure that the Docker containers can resolve each other by container name, we create a Docker network for them:

docker network create --subnet=192.168.42.0/24 dkrnet

Docker containers

In order to run the applications in container, execute the following script:

./docker-run-local.sh

Alternatively, you can run the containers individually, in multiple terminal sessions:

docker run --rm \
  --network=dkrnet \
  --name=barista \
  barista:1

docker run --rm \
  -p 9080:9080 \
  -p 9443:9443 \
  --network=dkrnet \
  --name=coffee-shop \
  coffee-shop:1

Run Zipkin

docker run -d \
  -p 9411:9411 \
  --network=dkrnet \
  --name=zipkin \
  openzipkin/zipkin

About

License:Apache License 2.0


Languages

Language:Java 84.8%Language:Dockerfile 8.7%Language:Shell 6.5%