I am a beginner to Docker and web applications in general. I have to Dockerize a Spring Boot Java app that uses Kafka, Zookeeper, and MongoDB. It also uses the Gradle build tool. I am thinking of first using Gradle to build the app into a JAR file. Then I will start Docker containers for Kafka, Zookeeper, and MongoDB. After that I will compose a Dockerfile to run the JAR file with something like this:
ADD /javaApp/build/libs/javaApp.jar javaApp.jar
ENTRYPOINT [“java”, “-Dspring.config.location=‘location of Spring Boot config file’”, “-jar”,“javaApp.jar”]
After that, I have to get these different containers to link and talk to each other. What would be the best approach to do this? Should I use a Docker-Compose file perhaps?