postgis / docker-postgis

Docker image for PostGIS
https://hub.docker.com/r/postgis/postgis/
MIT License
1.37k stars 462 forks source link

Unable to connect it with other containers #227

Closed bansalnaman15 closed 3 years ago

bansalnaman15 commented 3 years ago

I am using docker-compose and I want to connect it with 2 other containers, So, I am defining a service name in docker-compose.yml and using that service name at the place of host IP, this seems to be giving an error.

raise OSError(err, f'Connect call failed {address}') final_1 | ConnectionRefusedError: [Errno 111] Connect call failed ('172.20.0.2', 5432)

phillipross commented 3 years ago

This doesn't look like an error explicitly with the container image. You can try testing with the official postgres image and see if the problem exists when you use that container image. The postgis container image is actually based on the postgres image.

bansalnaman15 commented 3 years ago

Thank you for replying. Actually, I got it fixed, I was using '@' in the DB URI connection string from my python app container, hence it was creating errors. The image is perfectly fine. Thanks.