title: How to connect a Postgres Docker image from another Docker container
body: <p>I am trying to set up <a href="https://github.com/BulletTrainHQ/bullet-train-api" rel="nofollow noreferrer">this Bullet Train API server</a> on our machines. I am successfully able to run their Python server using the <code>docker-compose up</code> method.</p>
  
  <p>As per the docs, it needs the database as well. I preferred using the docker image for the Postgres DB <code>docker run --name local_postgres -d -P postgres</code> which returns this:</p>
  
  <p><a href="https://i.stack.imgur.com/OQldV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OQldV.png" alt="fb8b349961ff064e652d4f76402acd900c2fe4764475e3f487e84afd7407f70c"></a></p>
  
  <p>It doesn't return a success message saying if the Postgres Docker is running successfully or not. It just returns some kinda long string which I feel should be an identifier of the Postgres Docker image.</p>
  
  <p>As I need to connect <a href="https://github.com/BulletTrainHQ/bullet-train-api" rel="nofollow noreferrer">this Bullet Train API server</a> to this Dockerized database -</p>
  
  <p>The question is how to find the connection string for this Postgres Docker image?</p>