File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ jobs:
159159 SCP_COMMAND="scp -i ec2.pem -o StrictHostKeyChecking=no"
160160
161161 # Ensure Docker + AWS CLI installed on EC2
162- $SSH_COMMAND "sudo apt-get update -y && sudo apt-get install -y docker.io docker-compose-plugin awscli"
162+ $SSH_COMMAND "sudo apt-get update -y && sudo apt-get install -y docker.io awscli"
163163
164164 #Login to Docker registry
165165 $SSH_COMMAND "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY aws ecr get-login-password --region us-east-1 | sudo docker login --username AWS --password-stdin $ECR_REGISTRY"
@@ -172,7 +172,7 @@ jobs:
172172
173173 # Pull and run the Docker container on EC2
174174 $SSH_COMMAND "sudo docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
175- $SSH_COMMAND "cd /home/ubuntu/ docker/ && sudo docker compose -f docker-compose.yml up -d --force-recreate "
175+ $SSH "cd ~/ docker && sudo docker run -d $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG "
176176
177177 # Cleanup PEM key
178178 rm -f ec2.pem
You can’t perform that action at this time.
0 commit comments