I solved it this way:
First, I stopped all running containers:
docker-compose down
Then I executed a lsof
command to find the process using the port (for me it was port 9000)
sudo lsof -i -P -n | grep 9000
Finally, I "killed" the process (in my case, it was a VSCode extension):
kill -9 <process id>