✅ How to fix it
The issue happens because PostgreSQL is already running on your Mac and is using port 5432, which conflicts with your Docker container. Here’s how you can resolve it:
1️⃣ Stop PostgreSQL properly on macOS
Since you installed PostgreSQL via Homebrew, the correct way to stop it is:
brew services stop postgresql
Then, check if the port is still in use:
sudo lsof -i :5432
2️⃣ Kill the process manually (if needed)
If PostgreSQL is still running, force it to stop by killing the process:
sudo kill -9 521 # Replace 521 with the actual PID
Then, verify again:
sudo lsof -i :5432