EC2 User Data runs script but does not boot up application
<p>I have a custom AMI that has my app directory and a docker image. I'm setting up Auto Scale Group with Launch Configuration to create a new instance. I have a User Data script to boot up the application. This is the code: </p>

<pre><code>#!/bin/bash

docker-compose -f /home/ec2-user/app/docker-compose.yaml up -d app
</code></pre>

<p>the script runs, but the app doesn't run. I can SSH and run the app manually which works. Looking at the cloud-init-output.log file, I'm getting the following: </p>

<p><code>/var/lib/cloud/instance/scripts/part-001: line 4: docker-compose: command not found</code></p>

<p>Docker-compose is available when I SSH as I've installed it before creating my custom AMI. </p>

<p>Anything I'm missing? </p>