Communication between multiple docker-compose projects

0 votes

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?

Apr 30, 2022 in Docker by Abhijeet
• 180 points

edited 4 days ago 9 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP