Creating a docker-compose file

Now, we have docker-compose installed and we can try to work with the tool. We want to run the whole stack with a single command. We will create the yaml file to represent the stack. Our yaml file should have the Redis container, the RabbitMQ container, the Tracked Hashtag application, the Gathering application, and finally, the Dispatcher application.

We can create a docker-compose.yaml file wherever we want, there is no restriction for that.

Our docker-compose.yaml file should look like the following:

version: '3'services:  rabbitmq:    image: rabbitmq:3.7.0-management-alpine    hostname: rabbitmq    ports:      - "5672:5672"      - "15672:15672"    networks:      - solution   redis:    image: "redis:4.0.6-alpine"    hostname: redis ports: ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.