Networks configuration of docker's docker-compose.yml file

official docker-compose.yml file example: https://docs.docker.com/compo.

in the official example, networks looks like this:

networks:
  frontend:
  backend:

question:
networks what does the value of frontend , backend mean? Other examples from Baidu are written in a variety of ways.

Aug.30,2021

frontend and backend are custom network that need to be created manually (for example: docker network create frontend )

this allows you to declare and use

in the compose file.

I gave a detailed answer to the question next door:
https://codeshelper.com/q/10.

.

networks in docker-compose.yml file is only supported by version 1 or above. And you need to create it with the docker network create [name] command before you can use it in docker-compose.yml, and you must formulate external:true .

Menu