How to make containers created with different Docker Compose files communicate to each other

docker network create YOUR_NETWORK_NAME
version: '3.7'services:
service1:
build: ./service1
command: ['yarn', 'run', 'start:dev']

service2:
build: ./service2
networks:
default:
external:
name: YOUR_NETWORK_NAME
version: '3.7'services:
service3:
build: ./service3

service4:
build: ./service4
networks:
default:
external:
name: YOUR_NETWORK_NAME

Full-stack developer in Sydney

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store