superpants@lemmy.worldtoDocker@lemmy.world•Connection to server at "127.0.0.1", port 5432 failed: Connection refusedEnglish
2·
11 months agoSorry, I misread your compose file. It should be the name of the PG container, so db:5432
Sorry, I misread your compose file. It should be the name of the PG container, so db:5432
deleted by creator
The python container should connect on postgres:5432
not localhost. To the web container, localhost is itself, not the physical host running docker
A plug for the pro Kubernetes crowd:
I run microk8s on a 3 node cluster, using FluxCD to deploy and manage my services. I also work with Kubernetes at work, so I’m very familiar with the concepts. But I will never use anything else.
If you want maximum control and flexibility, learn Kubernetes. For a lot of people (myself included) it’s overkill, but IMO it’s the best.
My main gripe with docker-compose, which is what I used to use, is that service changes require access to the machine. I have to run commands on the host to alter services. With Kubernetes, and more precisely a GitOps model, you can just make a commit to a git repo and it will roll out.