mirror of
https://github.com/docker/compose.git
synced 2025-07-30 09:04:12 +02:00
Merge pull request #3359 from bfirsh/clarify-compose-file-networks-documentation
Clarify service networks documentation
This commit is contained in:
commit
1988dfeaf0
@ -502,9 +502,11 @@ the special form `service:[service name]`.
|
|||||||
Networks to join, referencing entries under the
|
Networks to join, referencing entries under the
|
||||||
[top-level `networks` key](#network-configuration-reference).
|
[top-level `networks` key](#network-configuration-reference).
|
||||||
|
|
||||||
networks:
|
services:
|
||||||
- some-network
|
some-service:
|
||||||
- other-network
|
networks:
|
||||||
|
- some-network
|
||||||
|
- other-network
|
||||||
|
|
||||||
#### aliases
|
#### aliases
|
||||||
|
|
||||||
@ -516,14 +518,16 @@ Since `aliases` is network-scoped, the same service can have different aliases o
|
|||||||
|
|
||||||
The general format is shown here.
|
The general format is shown here.
|
||||||
|
|
||||||
networks:
|
services:
|
||||||
some-network:
|
some-service:
|
||||||
aliases:
|
networks:
|
||||||
- alias1
|
some-network:
|
||||||
- alias3
|
aliases:
|
||||||
other-network:
|
- alias1
|
||||||
aliases:
|
- alias3
|
||||||
- alias2
|
other-network:
|
||||||
|
aliases:
|
||||||
|
- alias2
|
||||||
|
|
||||||
In the example below, three services are provided (`web`, `worker`, and `db`), along with two networks (`new` and `legacy`). The `db` service is reachable at the hostname `db` or `database` on the `new` network, and at `db` or `mysql` on the `legacy` network.
|
In the example below, three services are provided (`web`, `worker`, and `db`), along with two networks (`new` and `legacy`). The `db` service is reachable at the hostname `db` or `database` on the `new` network, and at `db` or `mysql` on the `legacy` network.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user