I've two docker-compose files, one contains the solution with multiple API's the other contains some background running programs.
The problem is that one background program uses the API that runs in the other compose file. I was hoping I could use cotnainername as http://[CONTAINERNAME]:80 but that isn't working, the url is not known. I think it is because it's not known in that compose file? What is the solution for this case?
Below the simplified (removed the other services) docker-compose.yml's
file1:
version: '3.3'
services:
firstapi:
image: firstapi:latest
container_name: firstapi
ports:
- "4005:80"
file2:
version: '3.3'
services:
firsttool:
image: firsttool:latest
container_name: firsttool
environment:
- Endpoint_FirstAPI=http://firstapi:80