title: How to deploy MySQL docker image on AWS ECS?
body: <p>I have troubles deploying <strong>MySQL</strong> image on <strong>AWS ECS FARGATE</strong>.</p>
  
  <p>The cloudformation script that i have is this (dont mind the syntax, i am using python lib <em>Troposphere</em> to manage cloudfromation templates):</p>
  
  <pre><code>    TaskDefinition(
              'WordpressDatabaseTaskDefinition',
              RequiresCompatibilities=['FARGATE'],
              Cpu='512',
              Memory='2048',
              NetworkMode='awsvpc',   
              ContainerDefinitions=[
                  ContainerDefinition(
                      Name='WordpressDatabaseContainer',
                      Image='mysql:5.7',
                      Environment=[
                          Environment(Name='MYSQL_ROOT_PASSWORD', Value='root'),
                          Environment(Name='MYSQL_DATABASE', Value='wpdb'),
                          Environment(Name='MYSQL_USER', Value='root'),
                          Environment(Name='MYSQL_PASSWORD', Value='root'),
                      ],
                      PortMappings=[
                          PortMapping(
                              ContainerPort=3306
                          )
                      ]
                  )
              ]
          )
  </code></pre>
  
  <p>The deployment succeeds. I can even see that the task is running for few seconds until its state changes to <strong>STOPPED</strong>.</p>
  
  <p>The only thing that i can see is:</p>
  
  <ol>
  <li>Stopped reason Essential container in task exited</li>
  <li>Exit Code   1</li>
  </ol>
  
  <p>On localhost it works like a charm. What am i doing here wrong? At least - are there ways to debug this?</p>