mirror of https://github.com/docker/docs.git
Update composefile versions and quotes in examples
Changed version from 2 to 3, updated quotation marks to match example, changed front and back to frontend and backend.
This commit is contained in:
parent
61ea4f090b
commit
0cdec66639
|
@ -20,8 +20,7 @@ identical to the container name.
|
||||||
|
|
||||||
For example, suppose your app is in a directory called `myapp`, and your `docker-compose.yml` looks like this:
|
For example, suppose your app is in a directory called `myapp`, and your `docker-compose.yml` looks like this:
|
||||||
|
|
||||||
version: '2'
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
|
@ -55,8 +54,9 @@ If any containers have connections open to the old container, they will be close
|
||||||
|
|
||||||
Links allow you to define extra aliases by which a service is reachable from another service. They are not required to enable services to communicate - by default, any service can reach any other service at that service's name. In the following example, `db` is reachable from `web` at the hostnames `db` and `database`:
|
Links allow you to define extra aliases by which a service is reachable from another service. They are not required to enable services to communicate - by default, any service can reach any other service at that service's name. In the following example, `db` is reachable from `web` at the hostnames `db` and `database`:
|
||||||
|
|
||||||
version: '2'
|
version: "3"
|
||||||
services:
|
services:
|
||||||
|
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
links:
|
links:
|
||||||
|
@ -80,33 +80,33 @@ Each service can specify what networks to connect to with the *service-level* `n
|
||||||
|
|
||||||
Here's an example Compose file defining two custom networks. The `proxy` service is isolated from the `db` service, because they do not share a network in common - only `app` can talk to both.
|
Here's an example Compose file defining two custom networks. The `proxy` service is isolated from the `db` service, because they do not share a network in common - only `app` can talk to both.
|
||||||
|
|
||||||
version: '2'
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
proxy:
|
proxy:
|
||||||
build: ./proxy
|
build: ./proxy
|
||||||
networks:
|
networks:
|
||||||
- front
|
- frontend
|
||||||
app:
|
app:
|
||||||
build: ./app
|
build: ./app
|
||||||
networks:
|
networks:
|
||||||
- front
|
- frontend
|
||||||
- back
|
- backend
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres
|
||||||
networks:
|
networks:
|
||||||
- back
|
- backend
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
front:
|
frontend:
|
||||||
# Use a custom driver
|
# Use a custom driver
|
||||||
driver: custom-driver-1
|
driver: custom-driver-1
|
||||||
back:
|
backend:
|
||||||
# Use a custom driver which takes special options
|
# Use a custom driver which takes special options
|
||||||
driver: custom-driver-2
|
driver: custom-driver-2
|
||||||
driver_opts:
|
driver_opts:
|
||||||
foo: "1"
|
foo: "1"
|
||||||
bar: "2"
|
bar: "2"
|
||||||
|
|
||||||
Networks can be configured with static IP addresses by setting the [ipv4_address and/or ipv6_address](compose-file.md#ipv4-address-ipv6-address) for each attached network.
|
Networks can be configured with static IP addresses by setting the [ipv4_address and/or ipv6_address](compose-file.md#ipv4-address-ipv6-address) for each attached network.
|
||||||
|
|
||||||
|
@ -119,9 +119,9 @@ For full details of the network configuration options available, see the followi
|
||||||
|
|
||||||
Instead of (or as well as) specifying your own networks, you can also change the settings of the app-wide default network by defining an entry under `networks` named `default`:
|
Instead of (or as well as) specifying your own networks, you can also change the settings of the app-wide default network by defining an entry under `networks` named `default`:
|
||||||
|
|
||||||
version: '2'
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
|
@ -129,8 +129,8 @@ Instead of (or as well as) specifying your own networks, you can also change the
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
# Use a custom driver
|
# Use a custom driver
|
||||||
driver: custom-driver-1
|
driver: custom-driver-1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue