title: Docker container on ECS times out when communicating RDS Postgres
body: <p>I have a dockerized nodejs application on ECS which is supposed to connect to postgres instance located on Amazon RDS. </p>
  
  <p>Locally, I am able to run the docker container and connect (read/write) to the RDS database</p>
  
  <p>When I deploy the container to ECS, I get a timeout when trying to read/write to the RDS Postgres DB.</p>
  
  <p>I built my docker container like so</p>
  
  <p><code>docker build -t my-app .</code></p>
  
  <p>I then ran my docker app</p>
  
  <p><code>docker run -p 80:3000 XXXXXXX</code> </p>
  
  <p>My RDS instance is running at <code>myappdb.ceonhqpz1vl1.us-east-1.rds.amazonaws.com:5432/appdb</code></p>
  
  <p>I figured this must be a port issue, but I published the ports as stated above. So i figure this must work. But when I run the app through my browser on AWS and try to read/write to the DB, the request takes a long time and then times out. </p>
  
  <p>I'm not sure where to debug at this point, I'm a bit new to docker</p>