This demo illustrates how to connect two services using a docker compose configuration
- Gradle or Maven Recommendation: use a package manager
- Java SDK >= 1.8
- Set JAVA_HOME
- Docker and Docker Compose
If you use gradle install the wrapper first
gradle wrapper
Next you need to build the services by calling
./gradlew build
from directory child as well as from directory parent. There might be some warnings during compilation which can be ignored.
After compilation has been successful for both directories in each of them a executable jar file has been created with the same name:
[child|parent]/build/libs/gs-spring-boot-docker-0.1.0.jar.
Going back to the root directory of that service example where docker-compose.yml is laying the docker images can be build using the following command
docker-compose build
When building has been successful it is finally possible to run the containers by calling
docker-compose up
You may add the option -d
in order to run detached mode.