mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user