Skip to content

joesajigeorge/ansible_docker-compose_deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Container Deployment using Ansible

To deploy docker-compose application using Ansible.

Build

The container image is build using GitHub Actions and pushed to DockerHub.

Make sure you updated the secrets before running the pipeline. Follow the below steps:

  • Go to Settings
  • then Secrets and Variables
  • Select Actions
  • Under repository Secrets, add the DockerHub credentials as secrets (DOCKER_USERNAME and DOCKER_PASSWORD).

Deploy

Before deployment update the inventory file. In my example I am deploying to the same server.

Use the below command to deploy the Ansible playbook.

ansible-playbook --inventory inventory deployer.yml 

image

Add sh -vv flag to the above command to get more detailed log.

Once deployment has been completed, ssh to the remote system and check the container status.

docker ps

image

About

Deploy docker-compose application to servers using Ansible

Topics

Resources

Stars

Watchers

Forks