By romainjouin
I asked a detailed question on stackoverflow, with images : https://stackoverflow.com/questions/65012898/cant-connect-to-postgresql-from-a-same-host-container
Here is a copy of the text :
I am using docker to manage my Django apps, and have the same configuration on my laptop and digital ocean :
From my laptop I can connect to PostGreSQL thanks to the adminR image (https://hub.docker.com/_/adminer)
But if I try to connect to PostGreSQL from adminer on the localhost, I can’t !
I can ping and find PostGreSQL from the django container, but I can’t migrate my database from django scripts.
Funny enough, I can migrate on the digital ocean cloud from my laptop : and I can see the updated database on my laptop’s admineR page.
So the issue is obviously an issue of networking between the containers… But if I can ping the service, why can’t django access it ???
(Please refer to Stackoverflow’s question to have schema and images explaining the whole thing : https://stackoverflow.com/questions/65012898/cant-connect-to-postgresql-from-a-same-host-container )
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.