Skip to content

Commit 323c3db

Browse files
authored
Update main.yml
1 parent e5e9614 commit 323c3db

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)