How do I connect from my host to a docker postgresql container, with a traefik "url"?

I need to connect with a postgresql container via psql onto the host console.

Something like this:

#> psql -h my-pg-service -U postgres -d postgres

How do I declare a docker-compose traefik postgresql service , for I can do this connection ?