Amazon Elastic Container Registry (ECR) is the private Docker image registry for Innovatech Chile. The CI/CD pipeline builds images from the multi-stage Dockerfiles and pushes them to ECR on every merge toDocumentation 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.
main. At deploy time, EC2 instances authenticate with ECR and pull the latest images before starting containers.
Repositories
Three private ECR repositories store one image each:| Repository name | Service | Port |
|---|---|---|
tienda-frontend | React/NGINX frontend | 80 |
tienda-backend | Spring Boot Ventas API | 3001 |
tienda-backend-despachos | Spring Boot Despachos API | 3002 |
latest tag. The full image URI pattern is:
Authenticating with ECR
ECR uses short-lived tokens issued by the AWS CLI. Run the following command to authenticate your local Docker daemon before pulling or pushing:ec2-web runs this same command using the instance’s IAM role credentials (no static keys required):
01-pull_and_deploy.sh
The
LabRole IAM role attached to all EC2 instances includes ECR read permissions (ecr:GetAuthorizationToken, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer). No additional IAM configuration is required.Pulling images with Docker Compose
docker-compose.yml reads AWS_ACCOUNT_ID from the environment to build the full ECR image URI for each service:
docker-compose.yml
IAM permissions
All EC2 instances use the pre-existingLabRole IAM role via the LabRoleProfile-* instance profile provisioned by Terraform. This role grants the permissions required to:
- Retrieve an ECR authorization token (
ecr:GetAuthorizationToken) - Pull image layers from any repository in the account (
ecr:BatchGetImage,ecr:GetDownloadUrlForLayer) - Use SSM Session Manager for remote command execution without opening SSH ports
How the CI/CD pipeline pushes images
The GitHub Actions workflow builds and pushes all three images to ECR on every push tomain, then triggers rolling container updates on the EC2 instances via SSM. See the CI/CD pipeline documentation for the full workflow.
The build and push steps in the workflow follow this pattern for each service:
deploy.yml
deploy-by-ssm job sends shell commands to ec2-web and ec2-app via AWS SSM to pull the new images and restart the containers.