3.4 Running the Lab

Building the docker image for the order microservice and start the environment.

In the previous section we implemented the microservice. Lets build and run it.

Building

The order microservice provides a multistage Dockerfile for building the java application and creating a docker container.

Task 3.4.1 - Build docker container

Change to base directory of this lab <PROJECT_ROOT>/code/rest and run docker build.

1
docker build -f rest-order/src/main/docker/Dockerfile.multistage.jvm -t microservices-lab-rest-order:latest rest-order

Running

Task 3.4.2 - Starting with Docker Compose

Enter a shell and change your directory to the <PROJECT_ROOT>/code/rest/docker folder.

If you have any previous lab running stop these containers

1
docker-compose down --remove-orphans

Start the microservices with

1
2
3
4
5
6
7
8
9
$ docker-compose up -d
Starting rest-alertmanager    ... done
Starting rest-jaeger          ... done
Starting rest-grafana         ... done
Starting rest-prometheus      ... done
Starting rest-stock-db        ... done
Starting rest-order-db        ... done
Starting rest-stock           ... done
Starting rest-order           ... done
Last modified February 12, 2024: fix debezium lab version (9e6013e)