refactor
This commit is contained in:
parent
08ad3d672d
commit
5ba581eb03
5 changed files with 316 additions and 100 deletions
|
@ -7,6 +7,8 @@ repo: https://github.com/docker/compose
|
|||
# Docker Compose
|
||||
Compose is a tool for defining and running multi-container [Docker](Docker.md) applications. With Compose, you use a [YAML](../files/YAML.md) file to configure your application's services. Then, with a single command, you create and start all the services from your configuration.
|
||||
|
||||
#todo -> add docker-compose cli usage
|
||||
|
||||
## Docker Compose file
|
||||
The Compose file is a [YAML](../files/YAML.md) file defining:
|
||||
- Version (Optional)
|
||||
|
@ -26,7 +28,7 @@ services:
|
|||
build: ./dir
|
||||
``````
|
||||
|
||||
Or, as an object with the path specified under context and optionally Dockerfile and args:
|
||||
Or, as an object with the path specified under context and optionally [Dockerfile](Dockerfile.md) and args:
|
||||
```yaml
|
||||
version: "3.8"
|
||||
services:
|
||||
|
@ -44,7 +46,7 @@ Override the default command.
|
|||
command: bundle exec thin -p 3000
|
||||
```
|
||||
|
||||
The command can also be a list, in a manner similar to dockerfile:
|
||||
The command can also be a list, in a manner similar to [dockerfile](Dockerfile.md):
|
||||
```yaml
|
||||
command: ["bundle", "exec", "thin", "-p", "3000"]
|
||||
```
|
||||
|
@ -76,7 +78,7 @@ devices:
|
|||
### `entrypoint`
|
||||
`entrypoint` declares the default entrypoint for the service container. This overrides the ENTRYPOINT instruction from the service's Dockerfile.
|
||||
|
||||
If entrypoint is non-null, Compose ignores any default command from the image, for example the CMD instruction in the Dockerfile.
|
||||
If entrypoint is non-null, Compose ignores any default command from the image, for example the CMD instruction in the [Dockerfile](Dockerfile.md).
|
||||
|
||||
In its short form, the value can be defined as a string:
|
||||
```yaml
|
||||
|
@ -120,9 +122,9 @@ environment:
|
|||
When both env_file and environment are set for a service, values set by environment have precedence.
|
||||
|
||||
### `healthcheck`
|
||||
`healthcheck` declares a check that's run to determine whether or not the service containers are "healthy". It works in the same way, and has the same default values, as the HEALTHCHECK Dockerfile instruction
|
||||
`healthcheck` declares a check that's run to determine whether or not the service containers are "healthy". It works in the same way, and has the same default values, as the HEALTHCHECK [Dockerfile](Dockerfile.md) instruction
|
||||
|
||||
set by the service's [Docker](Docker.md) image. Your Compose file can override the values set in the Dockerfile.
|
||||
set by the service's [Docker](Docker.md) image. Your Compose file can override the values set in the [Dockerfile](Dockerfile.md).
|
||||
|
||||
```yaml
|
||||
healthcheck:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue