Home Explore Blog CI



docker

1st chunk of `content/includes/compose/services-volumes.md`
d3b4707a36c5a7f798e8697e78d7aee7dc2e8ee85c555fda00000001000001b7
The `volumes` attribute define mount host paths or named volumes that are accessible by service containers. You can use `volumes` to define multiple types of mounts; `volume`, `bind`, `tmpfs`, or `npipe`. 

If the mount is a host path and is only used by a single service, it can be declared as part of the service
definition. To reuse a volume across multiple services, a named
volume must be declared in the `volumes` top-level element.

Title: Volumes Attribute in Docker Compose
Summary
The `volumes` attribute in Docker Compose defines mount points for service containers, allowing access to host paths or named volumes. Mounts can be of type `volume`, `bind`, `tmpfs`, or `npipe`. Single-service host path mounts are defined within the service definition, while reusable volumes across multiple services require declaration in the top-level `volumes` element.