I'm using Windows 11 and I spun up a PostgreSQL container with the following command: `docker run --name goalgetter -e POSTGRES_DB=goalgetter -e POSTGRES_USER=goalgetter -e POSTGRES_PASSWORD=goalgetter -p 5432:5432 -d postgres`. I've made sure to use the same names everywhere to avoid mismatches, but I'm still unable to connect. On DBeaver, I've set up my connection with these details: host as localhost, port 5432, database goalgetter, username goalgetter, and password goalgetter. This issue is new for me — I've successfully used a similar Docker setup before with a Flutter project. After factory resetting my Windows 11, I believe I've reinstalled the necessary drivers too. Last week, I struggled to connect NestJS to the database, and since DBeaver can't connect either, I'm at a loss. I even went into PostgreSQL via `psql` and set the password again, but nothing seems to work. Any help would be appreciated!
3 Answers
Are your services in the same Docker container or different ones? I deal with separate containers for the database, front-end, and back-end, and had to create a Docker network to connect them. Check your Docker networks and see which containers are in them; that might give you a clue.
Have you checked your Windows firewall settings? Sometimes it can block connections to Docker containers, which would explain your connection issues.
It sounds like you might be connecting to the wrong host. Try using your actual Docker host IP instead of 'localhost'. If you're using Docker Desktop with WSL, the networking can be a bit different, so check that out in the documentation. Without more details, that's about all I can suggest!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically