Skip to content

Commit dee8939

Browse files
prk0ghyusha-mandya
andauthored
Add information on compose usage. (docker#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>
1 parent f4b06da commit dee8939

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

storage/bind-mounts.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,28 @@ $ docker run -d \
376376
nginx:latest
377377
```
378378

379+
380+
## Use a bind mount with compose
381+
382+
A single Docker Compose service with a bind mount looks like this:
383+
384+
```yaml
385+
version: "{{ site.compose_file_v3 }}"
386+
services:
387+
frontend:
388+
image: node:lts
389+
volumes:
390+
- type: bind
391+
source: ./static
392+
target: /opt/app/staticvolumes:
393+
myapp:
394+
```
395+
396+
For more information about using volumes of the `bind` type with Compose, see
397+
[Compose reference on volumes](../compose/compose-file/compose-file-v3.md#volumes).
398+
and
399+
[Compose reference on volume configuration](../compose/compose-file/compose-file-v3.md#volume-configuration-reference).
400+
379401
## Next steps
380402

381403
- Learn about [volumes](volumes.md).

0 commit comments

Comments
 (0)