I have a docker-compose
that spins up 2 Docker containers. One is an application (on port:8090
) and the other is a database (on port:5432
). I also have a Windows application that has an API accessible through localhost:8002
. I want to use my container that has the application to read data from the localhost:8002
API, then move that data to my database in my other Docker container.
For docker-compose
, I mapped port 5432:5432
and port 8090:8090
for the database and application containers, respectively. I have tested my application non-dockerized where I call the Windows API and then write it to port:5432
and it works properly.
However, after Dockerizing my application, localhost:8002
is now no longer localhost for my Dockerized application and is now unreachable. I am wondering how I can reach my host localhost:8002
, hit that API, then move that data to my other container.