How it works...
From step 1 through to step 5, we created a basic application inside the directory docker_compose along with our Ansible task. We added a simple Flask application to serve requests with the Hello World! response. To demonstrate a use-case of Docker Compose, we added a dependency to our application, using Redis to display a website's total number of hits. We created a Dockerfile containing statements to build our application container. Finally, we created docker-compose.yml, where we added dependencies for the application, that is, Redis.
Here, we have defined two services: one is a web-based service, which is a Flask application, and the other is Redis, which acts as a data store for the web service.
In step 6, we used the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access