0

As the title explains i'm trying to connect 2 instances of docker-compose together. One is the data api, and the other is the actual application.

The solutions i've found are all docker-compose v2 or v1, nothing for version 3.

I've so far tried a normal docker-compose, but cant ping from one to the other. I've also tried adding networks, but this creates networks like this: DataAPI_network FrontEnd_network So they're not connecting to the same network.

I don't think i need to share actual code for this, if you want to know something more, please just leave a comment.

0

1 Answer 1

0

Mark your network as external in your compose files. The network will need to be pre-existing (create it using docker network create before calling docker-compose up).

See documentation, at the end of this page : https://docs.docker.com/compose/networking/#configure-the-default-network

BTW there is the same concept of external volumes.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, creating the network first and then adding it to the containers is the way it makes sense to work, just couldn't figure it out.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.