Docker Compose

Docker-Compose

By default Docker-Compose will create a new network for the given compose file. You can change the behavior by defining custom networks in your compose file.

Example:

1
2
3
4
5
6
7
networks:
  custom-network:

services:
  app:
    networks:
      - custom-network

If you want to use an existing Docker network for your compose files, you can add the external: true parameter in your compose file Example:

1
2
3
networks:
  existing-network:
    external: true