Add Docker-Compose Commands

This commit is contained in:
Mostafa Ghadimi 2019-07-23 13:29:39 +04:30 committed by GitHub
parent 9162173db7
commit c58c3318a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,6 +17,7 @@
* [Volumes](#volumes)
* [Exposing Ports](#exposing-ports)
* [Best Practices](#best-practices)
* [Docker-Compose](#docker-compose)
* [Security](#security)
* [Tips](#tips)
* [Contributing](#contributing)
@ -509,6 +510,24 @@ This is where general Docker best practices and war stories go:
* [Building a Development Environment With Docker](https://tersesystems.com/2013/11/20/building-a-development-environment-with-docker/)
* [Discourse in a Docker Container](https://samsaffron.com/archive/2013/11/07/discourse-in-a-docker-container)
## Docker-Compose
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your applications services. Then, with a single command, you create and start all the services from your configuration. To learn more about all the features of Compose, see the [list of features](https://docs.docker.com/compose/overview/#features).
By using the following command you can start up your application:
```
docker-compose -f <docker-compose-file> up
```
You can also run docker-compose in detached mode using -d flag, then you can stop it whenever needed by the following command:
```
docker-compose stop
```
You can bring everything down, removing the containers entirely, with the down command. Pass `--volumes` to also remove the data volume.
## Security
This is where security tips about Docker go. The Docker [security](https://docs.docker.com/engine/security/security/) page goes into more detail.