addVolume
Method
interface Service { // ... omitted for brevity addVolume( source: string, target: string, type?: string, isReadOnly?: boolean, configure?: callback): Service;}Signature
method
addVolume Adds a volume mount to a generated Docker Compose service.
addVolume(source: string, target: string, type?: string, isReadOnly?: boolean, configure?: (obj: Volume) => Promise<void>): ServiceParameters
sourcestringThe source volume name or host path.targetstringThe target path inside the container.typestringoptional= volumeThe Docker Compose volume type, such as `volume` or `bind`.isReadOnly booleanoptionalA value indicating whether the volume is mounted as read-only.configure(obj: Volume) => Promise<void> optionalAn optional callback for further volume customization.Returns
ServiceApplies to
This method applies to the following types: