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.

Joppe De Cuyper
  • 394
  • 1
  • 6
  • 17

1 Answers1

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.

lbndev
  • 781
  • 6
  • 14
  • 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. – Joppe De Cuyper Nov 02 '18 at 08:34