To workaround, instead of localhost, you’d have to use another special domain provided by Docker to connect to your computer’s localhost instead of the container’s. You can consult Docker’s documentation to find about it depending on the operative system you use (Windows, MacOS or Linux)