Changes to production.md for working with multiple Compose files.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-10-21 17:17:38 -04:00
parent 1c4c7ccfac
commit c5cf5cfad4
1 changed files with 11 additions and 19 deletions

View File

@ -12,11 +12,9 @@ weight=1
## Using Compose in production ## Using Compose in production
While **Compose is not yet considered production-ready**, if you'd like to experiment and learn more about using it in production deployments, this guide > Compose is still primarily aimed at development and testing environments.
can help. > Compose may be used for smaller production deployments, but is probably
The project is actively working towards becoming > not yet suitable for larger deployments.
production-ready; to learn more about the progress being made, check out the <a href="https://github.com/docker/compose/blob/master/ROADMAP.md">roadmap</a> for details
on how it's coming along and what still needs to be done.
When deploying to production, you'll almost certainly want to make changes to When deploying to production, you'll almost certainly want to make changes to
your app configuration that are more appropriate to a live environment. These your app configuration that are more appropriate to a live environment. These
@ -30,22 +28,16 @@ changes may include:
- Specifying a restart policy (e.g., `restart: always`) to avoid downtime - Specifying a restart policy (e.g., `restart: always`) to avoid downtime
- Adding extra services (e.g., a log aggregator) - Adding extra services (e.g., a log aggregator)
For this reason, you'll probably want to define a separate Compose file, say For this reason, you'll probably want to define an additional Compose file, say
`production.yml`, which specifies production-appropriate configuration. `production.yml`, which specifies production-appropriate
configuration. This configuration file only needs to include the changes you'd
like to make from the original Compose file. The additional Compose file
can be applied over the original `docker-compose.yml` to create a new configuration.
> **Note:** The [extends](extends.md) keyword is useful for maintaining multiple Once you've got a second configuration file, tell Compose to use it with the
> Compose files which re-use common services without having to manually copy and `-f` option:
> paste.
Once you've got an alternate configuration file, make Compose use it $ docker-compose -f docker-compose.yml -f production.yml up -d
by setting the `COMPOSE_FILE` environment variable:
$ export COMPOSE_FILE=production.yml
$ docker-compose up -d
> **Note:** You can also use the file for a one-off command without setting
> an environment variable. You do this by passing the `-f` flag, e.g.,
> `docker-compose -f production.yml up -d`.
### Deploying changes ### Deploying changes