Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions content/manuals/compose/how-tos/multiple-compose-files/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

Docker Compose lets you merge and override a set of Compose files together to create a composite Compose file.

By default, Compose reads two files, a `compose.yml` and an optional
`compose.override.yml` file. By convention, the `compose.yml`
By default, Compose reads two files, a `compose.yaml` and an optional
`compose.override.yaml` file. By convention, the `compose.yaml`
contains your base configuration. The override file can
contain configuration overrides for existing services or entirely new
services.
Expand All @@ -32,10 +32,10 @@
For example:

```console
$ docker compose -f compose.yml -f compose.admin.yml run backup_db
$ docker compose -f compose.yaml -f compose.admin.yaml run backup_db
```

The `compose.yml` file might specify a `webapp` service.
The `compose.yaml` file might specify a `webapp` service.

```yaml
webapp:
Expand All @@ -46,7 +46,7 @@
- "/data"
```

The `compose.admin.yml` may also specify this same service:
The `compose.admin.yaml` may also specify this same service:

```yaml
webapp:
Expand Down Expand Up @@ -226,7 +226,7 @@

### Additional information

- Using `-f` is optional. If not provided, Compose searches the working directory and its parent directories for a `compose.yml` and a `compose.override.yml` file. You must supply at least the `compose.yml` file. If both files exist on the same directory level, Compose combines them into a single configuration.
- Using `-f` is optional. If not provided, Compose searches the working directory and its parent directories for a `compose.yaml` and a `compose.override.yaml` file. You must supply at least the `compose.yaml` file. If both files exist on the same directory level, Compose combines them into a single configuration.

- You can use a `-f` with `-` (dash) as the filename to read the configuration from `stdin`. For example:
```console
Expand All @@ -246,12 +246,12 @@

- You can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either from the command line or by setting up a [COMPOSE_FILE environment variable](../environment-variables/envvars.md#compose_file) in your shell or in an environment file.

For example, if you are running the [Compose Rails sample](https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/rails/README.md), and have a `compose.yml` file in a directory called `sandbox/rails`. You can use a command like [docker compose pull](/reference/cli/docker/compose/pull.md) to get the postgres image for the `db` service from anywhere by using the `-f` flag as follows: `docker compose -f ~/sandbox/rails/compose.yml pull db`
For example, if you are running the [Compose Rails sample](https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/rails/README.md), and have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like [docker compose pull](/reference/cli/docker/compose/pull.md) to get the postgres image for the `db` service from anywhere by using the `-f` flag as follows: `docker compose -f ~/sandbox/rails/compose.yaml pull db`

Check failure on line 249 in content/manuals/compose/how-tos/multiple-compose-files/merge.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.Capitalization] Please capitalize Docker. Raw Output: {"message": "[Docker.Capitalization] Please capitalize Docker.", "location": {"path": "content/manuals/compose/how-tos/multiple-compose-files/merge.md", "range": {"start": {"line": 249, "column": 1}}}, "severity": "ERROR"}

Check failure on line 249 in content/manuals/compose/how-tos/multiple-compose-files/merge.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Postgres' instead of 'postgres'. Raw Output: {"message": "[Vale.Terms] Use 'Postgres' instead of 'postgres'.", "location": {"path": "content/manuals/compose/how-tos/multiple-compose-files/merge.md", "range": {"start": {"line": 249, "column": 335}}}, "severity": "ERROR"}

Here's the full example:

```console
$ docker compose -f ~/sandbox/rails/compose.yml pull db
$ docker compose -f ~/sandbox/rails/compose.yaml pull db
Pulling db (postgres:latest)...
latest: Pulling from library/postgres
ef0380f84d05: Pull complete
Expand Down Expand Up @@ -281,7 +281,7 @@
Start with a base file that defines the canonical configuration for the
services.

`compose.yml`
`compose.yaml`

```yaml
services:
Expand All @@ -301,7 +301,7 @@
In this example the development configuration exposes some ports to the
host, mounts our code as a volume, and builds the web image.

`compose.override.yml`
`compose.override.yaml`

```yaml
services:
Expand Down Expand Up @@ -329,7 +329,7 @@
To use this Compose app in a production environment, another override file is created, which might be stored in a different git
repository or managed by a different team.

`compose.prod.yml`
`compose.prod.yaml`

```yaml
services:
Expand All @@ -347,12 +347,12 @@
To deploy with this production Compose file you can run

```console
$ docker compose -f compose.yml -f compose.prod.yml up -d
$ docker compose -f compose.yaml -f compose.prod.yaml up -d
```

This deploys all three services using the configuration in
`compose.yml` and `compose.prod.yml` but not the
dev configuration in `compose.override.yml`.
`compose.yaml` and `compose.prod.yaml` but not the
dev configuration in `compose.override.yaml`.

Check failure on line 355 in content/manuals/compose/how-tos/multiple-compose-files/merge.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'dev'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'dev'?", "location": {"path": "content/manuals/compose/how-tos/multiple-compose-files/merge.md", "range": {"start": {"line": 355, "column": 1}}}, "severity": "ERROR"}

For more information, see [Using Compose in production](../production.md).

Expand Down
Loading