Defining networks on a Compose configuration
So far, our containers have been running and communicating transparently. This is because when we run a Compose application, a bridge network is created. Based on our previous examples, the containers have been able to interact with other Compose services and communicate through an alias:
$ docker network ls --filter name=chapter1_default NETWORK ID NAME DRIVER SCOPE 9ec7758d7050 chapter1_default bridge local
This can serve us for some time; however, we would like to have a different name for the network.
Adding a network in Compose is easy:
networks: task-manager-pubic-network: labels: - com.packtpub.compose.app=task-manager
However, creating a network is...