Configure Apache Webserver on top of Docker Container with help of Ansible Playbook



Starting with Downloading Docker

Firstly we will configure yum repository for docker in target node for downloading docker and then we will Install docker and will start docker service

We can see docker service is running in our Target Node

Now we will install pip3 command or can say python3 to download docker software development kit (sdk) for integrating docker with ansible

With help of ansible we now download httpd server image from docker hub and will copy content for website in /var/www/html file.

Now we will check in target node that our file index.html is present there or not.

Now we have to expose our container so everybody can see our website

Now if we try to connect with container IP and we see the web page i.e index.html with Output HTTP server on docker which we have written in index.html.

This is final playbook for our entire setup





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store