Hi guys, maybe someone can help me. I have this problem:
I want to dockerize two web application running on the same tomcat and on the same machine. One of the two web app is connected to a MySQL database running on another machine.
I tried to do in this way:
- External MySQL database running on the previous server
- two web apps running with docker ( two different docker container with tomcat)
- nginx as reverse proxy
- docker-compose for manage them
One app calls a service exposed by the other one. The url is given as a property (before I have for example App2.properties with -Dapp1.url=http://192.168.1.5/app1/api).
Now, with socket, I don’t know the ip of the app1 container. So, with nginx as reverse proxy, I tried to modify the property as -Dapp1.url=http://localhost:9090/app1/api (nginx is listening on port 9090 and on /app1 knows that has to serve the app1 container). But In my logs, I have “Connection refused” maybe because localhost inside the container is the IP of the container. But I have to reach the other app. Anyone can help me?