Getting started with Docker I do not understand why two containers on the same docker machine can't communicate through localhost.
I read about this SO post already : how-to-connect-two-docker-containers-through-localhost but could not get a clear answer.
My use case, I am on Windows Home using Docker Toolbox (virtualbox) having the current docker machine :
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v19.03.5
I am launching 3 services, one react application, one spring boot application, and one postgreSQL database.
In my understanding each one will be hosted on 192.168.99.100 on the port I specified (respectively 3000, 8080, 5432). So each one in their context should have localhost refering to 192.168.99.100.
I know it is not working like that because of CORS issues that I only get when launching the app environment with docker.
Why is that ? Can someone explain ?