This project sets up an automated way to deploy Docker Compose services on a CentOS server using Ansible. It includes secure handling of credentials, organized folder structures, and pulls Docker images and configurations directly from GitHub.
- A CentOS server connected to the internet to download Docker and retrieve files from GitHub.
- Ansible installed on the control machine.
- A GitHub repository with the Docker Compose file.
The playbook ensures Docker and Docker Compose are installed along with any necessary dependencies.
Using encrypted credentials, the playbook securely logs in to Docker Hub and pulls the required images for deployment.
The playbook pulls the Docker Compose configuration file from GitHub and starts the services as defined in the file.
Ansible verifies the services are up and accessible, runs diagnostic checks using nmap, and confirms the connectivity between containers.
This project is organized to make it easy to deploy and manage. Key parts include:
- Playbooks: The main automation files.
- docker_setup: A files for setting up Docker.
- Basic Architecture: Contains architecture picture for basic understanding.
Sensitive information, like Docker Hub credentials, is encrypted using Ansible Vault, making the deployment process secure.
- Set up your Vault password file for secure access to credentials.
- Run the playbook using:
ansible-playbook ansible/playbooks/deploy_docker_compose.yml --ask-vault-pass