TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DevOpsDuoc/Evaluacion02_Devop_Innovatech/llms.txt
Use this file to discover all available pages before exploring further.
proyect/remote-setup/ directory contains four shell scripts covering the full deployment lifecycle — from first-time Docker installation to Ansible-based cluster deployment. The scripts are designed to be run in order on a fresh Amazon Linux 2 EC2 instance, though each can also be used independently.
00-init.sh — install Docker on EC2
00-init.sh — install Docker on EC2
Run this script once on each EC2 instance before any containers are deployed. It installs Docker via
yum, enables the systemd service so Docker starts on reboot, adds ec2-user to the docker group so you can run Docker commands without sudo, and creates the ~/app directory used by the deploy script.After the script completes, log out and reconnect for the group membership change to take effect.proyect/remote-setup/00-init.sh
01-pull_and_deploy.sh — pull images and start services
01-pull_and_deploy.sh — pull images and start services
This is the main deploy script used by both the manual deployment process and the GitHub Actions pipeline (indirectly, via SSM commands). It authenticates Docker with Amazon ECR using the instance’s IAM role credentials, changes into
/home/ec2-user/app/, pulls the latest images defined in docker-compose.yml, and restarts the full stack.The AWS_ACCOUNT_ID environment variable must be set before running this script.proyect/remote-setup/01-pull_and_deploy.sh
The
--remove-orphans flag removes containers for services that are no longer defined in docker-compose.yml, keeping the running stack in sync with the Compose file.02-deployments.sh — manual per-instance deployment (earlier approach)
02-deployments.sh — manual per-instance deployment (earlier approach)
This script documents the original manual deployment approach used before Docker Compose and ECR were adopted. It builds images locally and runs individual containers on separate EC2 hosts — one for the database (
ec2-datos), one for the backend (ec2-app), and one for the frontend (ec2-web).Before running the backend section, set DB_HOST_IP to the private IP of the ec2-datos instance so the backend container can reach the database.proyect/remote-setup/02-deployments.sh
03-deploy_into_cluster.sh — Ansible-based cluster deployment
03-deploy_into_cluster.sh — Ansible-based cluster deployment
This script outlines an Ansible-based deployment alternative for deploying containers across the cluster. It installs the
community.docker Ansible Galaxy collection and then runs an ansible-playbook command using an inventory.ini file and a deploy_apps.yml playbook.The deploy_apps.yml playbook and inventory.ini files are not included in the repository and must be created separately before running this script.proyect/remote-setup/03-deploy_into_cluster.sh
You need Ansible installed on the control machine before running this script. The
community.docker collection provides Docker modules for managing containers, images, and networks through Ansible tasks.Script execution order
For a fresh EC2 instance, run the scripts in numeric order:Run 00-init.sh
Install Docker and create the application directory. Log out and back in after this step.
Place docker-compose.yml in ~/app
Copy the Compose file to
/home/ec2-user/app/ before the next step.