#!/bin/bash # Update system yum update -y # Install Docker amazon-linux-extras install docker -y service docker start usermod -a -G docker ec2-user chkconfig docker on # Install docker-compose curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose # Configure AWS CLI aws configure set region ${aws_region} # Login to ECR aws ecr get-login-password --region ${aws_region} | docker login --username AWS --password-stdin ${ecr_url} # Create environment file cat > /home/ec2-user/.env < /home/ec2-user/docker-compose.yml < /etc/systemd/system/api.service <