I have two apps (microservices) in separate docker composes
app1.yml
version: "3.4"
services:
app1:
image: flask-app1
environment:
- APP2_URL=http://localhost:8000
ports:
- 5000:8000
volumes:
- "../:/app/"
depends_on:
- db_backend1
restart: on-failure
db_backend1:
...
app2.yml
version: "3.4"
services:
app2:
image: flask-app2
ports:
- 8000:8000
volumes:
- "..:/app"
restart: on-failure
of course they have other dependecies (database server, etc) i need to run both of them locally, each of them can run well locally, but in this case app1 need to fetch data from app2 by sending a http get request, so i set the app2 url (http://localhost:8000) as an environment variable (just for dev purposes). but the always get requests exception error saying the connection end closed.
So, it will be great if anyone knows how to sort it out.