How can I connect Odoo not running on Docker to a Postgres container running on Docker?

I am trying to connect Odoo to a Postgres database instance which is running in Docker, but having trouble figuring out how to connect them. I created my instance like so:

$ docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name mydb postgres:10

Only Postgres is running in Docker, not Odoo. How would I connect the Postgres running inside Docker to the outside Odoo?

Source: StackOverflow