title: AWS Fargate docker compose instead of docker run
body: <p>I am using Cloud Formation to deploy my image from ECR to Fargate. My image uses docker-compose but upon deploying Fargate is running docker run and am unable to find an option where I can instruct in my Cloud Formation stack to run the docker compose up command instead of docker run</p>
  <p>My Cloud formation stack is:</p>
  <pre><code>{
          &quot;Resources&quot;: {
              &quot;VPCFARGATE&quot;: {
                  &quot;Type&quot;: &quot;AWS::EC2::VPC&quot;,
                  &quot;Properties&quot;: {
                      &quot;CidrBlock&quot;: &quot;10.0.0.0/16&quot;,
                      &quot;InstanceTenancy&quot;: &quot;default&quot;,
                      &quot;EnableDnsSupport&quot;: &quot;true&quot;,
                      &quot;EnableDnsHostnames&quot; : &quot;true&quot;
                  }
              },
              &quot;INTGATEWAY&quot;: {
                  &quot;Type&quot;: &quot;AWS::EC2::InternetGateway&quot;
              },
              &quot;ATTACHIG&quot;: {
                  &quot;Type&quot;: &quot;AWS::EC2::VPCGatewayAttachment&quot;,
                  &quot;DependsOn&quot;: [&quot;VPCFARGATE&quot;, &quot;INTGATEWAY&quot;],
                  &quot;Properties&quot;: {
                      &quot;InternetGatewayId&quot; : {&quot;Ref&quot;: &quot;INTGATEWAY&quot;},
                      &quot;VpcId&quot; : {&quot;Ref&quot;: &quot;VPCFARGATE&quot;}
                  }
              },
              &quot;ROUTETABLE&quot;: {
                  &quot;Type&quot; : &quot;AWS::EC2::RouteTable&quot;,
                  &quot;DependsOn&quot;: [&quot;VPCFARGATE&quot;],
                  &quot;Properties&quot; : {
                      &quot;VpcId&quot; : {&quot;Ref&quot;: &quot;VPCFARGATE&quot;}
                  }
              },
              &quot;ROUTE&quot;: {
                  &quot;Type&quot;: &quot;AWS::EC2::Route&quot;,
                  &quot;DependsOn&quot;: [&quot;VPCFARGATE&quot;, &quot;INTGATEWAY&quot;, &quot;ROUTETABLE&quot;],
                  &quot;Properties&quot;: {
                      &quot;RouteTableId&quot;: {&quot;Ref&quot;: &quot;ROUTETABLE&quot;},
                      &quot;DestinationCidrBlock&quot;: &quot;0.0.0.0/0&quot;,
                      &quot;GatewayId&quot;: {&quot;Ref&quot;: &quot;INTGATEWAY&quot;}
                  }
              },
              &quot;SUBNETFARGATE&quot;: {
                  &quot;Type&quot;: &quot;AWS::EC2::Subnet&quot;,
                  &quot;DependsOn&quot;: [&quot;VPCFARGATE&quot;],
                  &quot;Properties&quot;: {
                      &quot;AvailabilityZone&quot; : &quot;ap-south-1a&quot;,
                      &quot;CidrBlock&quot; : &quot;10.0.0.0/24&quot;,
                      &quot;MapPublicIpOnLaunch&quot; : &quot;true&quot;,
                      &quot;VpcId&quot; : {&quot;Ref&quot;: &quot;VPCFARGATE&quot;}
                  }
              },
              &quot;SUBNETROUTE&quot;: {
                  &quot;Type&quot; : &quot;AWS::EC2::SubnetRouteTableAssociation&quot;,
                  &quot;DependsOn&quot;: [&quot;SUBNETFARGATE&quot;, &quot;ROUTETABLE&quot;],
                  &quot;Properties&quot; : {
                      &quot;RouteTableId&quot; : {&quot;Ref&quot;: &quot;ROUTETABLE&quot;},
                      &quot;SubnetId&quot; : {&quot;Ref&quot;: &quot;SUBNETFARGATE&quot;}
                  }
              },
              &quot;SGFARGATE&quot;: {
                  &quot;Type&quot;: &quot;AWS::EC2::SecurityGroup&quot;,
                  &quot;DependsOn&quot;: [&quot;VPCFARGATE&quot;],
                  &quot;Properties&quot;: {
                      &quot;GroupDescription&quot; : &quot;Fargate Security Group&quot;,
                      &quot;GroupName&quot; : &quot;Fargate-SG&quot;,
                      &quot;SecurityGroupIngress&quot; : [
                          {
                              &quot;CidrIp&quot; : &quot;0.0.0.0/0&quot;,
                              &quot;Description&quot; : &quot;Allow HTTP traffic on port 80&quot;,
                              &quot;FromPort&quot; : 80,
                              &quot;IpProtocol&quot; : &quot;tcp&quot;,
                              &quot;ToPort&quot; : 80
                          },{
                              &quot;CidrIp&quot;: &quot;0.0.0.0/0&quot;,
                              &quot;Description&quot;: &quot;Allow HTTPS traffic on port 443&quot;,
                              &quot;FromPort&quot;: 443,
                              &quot;IpProtocol&quot;: &quot;tcp&quot;,
                              &quot;ToPort&quot;: 443
                          }
                      ],
                      &quot;VpcId&quot; : {&quot;Ref&quot;: &quot;VPCFARGATE&quot;}
                  }
              },
              &quot;FARGATECLUSTER&quot;: {
                  &quot;Type&quot;: &quot;AWS::ECS::Cluster&quot;,
                  &quot;Properties&quot;: {
                      &quot;ClusterName&quot;: &quot;Cluster-CF&quot;
                  }
              },
              &quot;ECSTASK&quot;: {
                  &quot;Type&quot;: &quot;AWS::ECS::TaskDefinition&quot;,
                  &quot;Properties&quot;: {
                      &quot;ContainerDefinitions&quot;: [
                          {
                              &quot;Name&quot;: &quot;johndoe&quot;,
                              &quot;Image&quot;: &quot;12345789.dkr.ecr.ap-south-1.amazonaws.com/johndoe:latest&quot;,
                              &quot;PortMappings&quot;: [
                                  {&quot;ContainerPort&quot;: 80, &quot;HostPort&quot;: 80, &quot;Protocol&quot;: &quot;tcp&quot;}
                              ],
                              &quot;LogConfiguration&quot;: {
                                  &quot;LogDriver&quot;: &quot;awslogs&quot;,
                                  &quot;Options&quot;: {
                                      &quot;awslogs-group&quot;: &quot;/ecs/task-medium&quot;,
                                      &quot;awslogs-region&quot;: &quot;ap-south-1&quot;,
                                      &quot;awslogs-stream-prefix&quot;: &quot;ecs&quot;
                                  }
                              }
                          }
                      ],
                      &quot;Cpu&quot;: 512,
                      &quot;Memory&quot;: 1024,
                      &quot;NetworkMode&quot;: &quot;awsvpc&quot;,
                      &quot;RequiresCompatibilities&quot;: [&quot;FARGATE&quot;],
                      &quot;TaskRoleArn&quot;: &quot;ecsTaskExecutionRole&quot;,
                      &quot;ExecutionRoleArn&quot;: &quot;ecsTaskExecutionRole&quot;,
                      &quot;Tags&quot;: [
                          {
                              &quot;Key&quot;: &quot;created_by&quot;,
                              &quot;Value&quot;: &quot;CloudFormation&quot;
                          }
                      ]
                  }
              },
              &quot;SERVICE&quot;: {
                  &quot;Type&quot;: &quot;AWS::ECS::Service&quot;,
                  &quot;DependsOn&quot;: [&quot;ECSTASK&quot;, &quot;FARGATECLUSTER&quot;, &quot;SUBNETFARGATE&quot;, &quot;SGFARGATE&quot;],
                  &quot;Properties&quot;: {
                      &quot;Cluster&quot; : &quot;Cluster-CF&quot;,
                      &quot;DeploymentConfiguration&quot; : {
                          &quot;MaximumPercent&quot;: 200,
                          &quot;MinimumHealthyPercent&quot;: 100
                      },
                      &quot;DeploymentController&quot; : {&quot;Type&quot;: &quot;ECS&quot;},
                      &quot;DesiredCount&quot; : 1,
                      &quot;LaunchType&quot; : &quot;FARGATE&quot;,
                      &quot;NetworkConfiguration&quot; : {
                          &quot;AwsvpcConfiguration&quot;: {
                              &quot;AssignPublicIp&quot; : &quot;ENABLED&quot;,
                              &quot;Subnets&quot;: [{&quot;Ref&quot;: &quot;SUBNETFARGATE&quot;}],
                              &quot;SecurityGroups&quot;: [{&quot;Ref&quot;: &quot;SGFARGATE&quot;}]
                          }
                      },
                      &quot;SchedulingStrategy&quot; : &quot;REPLICA&quot;,
                      &quot;ServiceName&quot; : &quot;Service-CF&quot;,
                      &quot;TaskDefinition&quot; : {&quot;Ref&quot;: &quot;ECSTASK&quot;}
                  }
              }
          }
      }
  </code></pre>