Fixing network.external.name is deprecated in Docker Compose

howto configure network.external.name on docker

* This page contains promotional content

When I rebuilt and started, for the first time in a while, a container that uses external in order to communicate between containers in different Docker environments, I ran into the error below

network default: network.external.name is deprecated. 
Please set network.name with external: true

The docker-compose.yml I had been using until then worked with the following


networks:
    default:
       external:
         name: ${NETWORK}

The compose version has gone up and the way it is written seems to have changed, and the format below is apparently the correct one


networks:
    default:
       name: ${NETWORK}
       external: true

Or


networks:
    ${NETWORK}
       external: ture