title: Can't connect to MySQL container on AWS ECS
body: <p>I can't seem to connect to a MySQL container in AWS ECS. Here's the docker-compose.yml I'm using with <code>ecs-cli compose up</code>:</p>
  
  <pre><code>version: '2'
  
  services:
    db:
      image: mysql:5.7
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: wordpress
        MYSQL_DATABASE: wordpress
        MYSQL_USER: wordpress
        MYSQL_PASSWORD: wordpress
      logging:
        driver: awslogs
        options:
          awslogs-group: "mylogs"
          awslogs-region: "us-east-2"
          awslogs-stream-prefix: "db"
      mem_limit: 300000000
  
    wordpress:
      depends_on:
        - db
      image: wordpress:latest
      ports:
        - "8000:80"
      restart: always
      environment:
        WORDPRESS_DB_HOST: db:3306
        WORDPRESS_DB_PASSWORD: wordpress
      logging:
        driver: awslogs
        options:
          awslogs-group: "mylogs"
          awslogs-region: "us-east-2"
          awslogs-stream-prefix: "web"
      mem_limit: 300000000
  </code></pre>
  
  <p>The error I get it is:</p>
  
  <pre><code>MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
  Warning: mysqli::mysqli(): php_network_getaddresses: getaddrinfo failed: Name or service not known in - on line 22 
  Warning: mysqli::mysqli(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in - on line 22
  </code></pre>
  
  <p>This seems to work fine locally but not in AWS ECS. Do I need to do something else for AWS?</p>