Add information on compose usage. (#14244)

* Add information on compose usage.

Add information on how to declare a bind mount in docke compose.

* Apply suggestions from code review

* Update storage/bind-mounts.md

Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>
This commit is contained in:
prk0ghy
2022-02-25 12:14:54 +01:00
committed by GitHub
parent f4b06da7b4
commit dee8939fee

View File

@@ -376,6 +376,28 @@ $ docker run -d \
nginx:latest
```
## Use a bind mount with compose
A single Docker Compose service with a bind mount looks like this:
```yaml
version: "{{ site.compose_file_v3 }}"
services:
frontend:
image: node:lts
volumes:
- type: bind
source: ./static
target: /opt/app/staticvolumes:
myapp:
```
For more information about using volumes of the `bind` type with Compose, see
[Compose reference on volumes](../compose/compose-file/compose-file-v3.md#volumes).
and
[Compose reference on volume configuration](../compose/compose-file/compose-file-v3.md#volume-configuration-reference).
## Next steps
- Learn about [volumes](volumes.md).