I am trying to deploy to EC2 using Bitbucket Pipelines and AWS CodeDeploy. I have everything setup so that the upload step for the CodeDeploy Agent works as it should, it's just that when I try running the statement in the deploy step, my script.sh /usr/local/bin/docker-compose -f /home/ec2-user/my-app/docker-compose.yml run --rm composer install
fails.
Everything else works and if I remove this step, it deploys successfully. If I try to execute this command manually it also works and the container for this runs and then exits as it should. I've checked permissions, changed my IAM setup and done everything I can think of before coming here.