Anchors and aliases let you identify an item with an anchor in a YAML document, and then refer to
that item with an alias later in the same document. Anchors are identified by an & character, and
aliases by an * character.
The following example will start up 3 nginx servers with the same volumes in ports 80, 81 and 82.
We can also use the prefix x- to set generic definition outside of the services definition. It
allows us to do something like this:
Scaling and port mapping
We can scale applications with the following commands:
However, if we want to bind ports to local ports, we need to set a range of ports instead in the
docker-compose.yml file: