In two different directories, I have two separate docker-compose.yml files:
- ~/front/docker-compose.yml
- ~/api/docker-compose.yml
How can I ensure that a container in the foreground can send requests to a container in the API?
I know that when using docker run for an individual container, the —default-gateway option can be used to provide a specific IP address to that container, however it appears that this option is not accessible when using docker-compose.
I'm currently conducting a docker inspect my api container id and looking at the output for the gateway. It works, but the issue is that this IP is assigned at random, thus I can't trust it.
My questions are as follows:
1. Is it possible to assign a fixed IP address to a container using docker-compose?
and
2. How can two docker-compose projects work together?