addVolume
Method
interface ComposeFile { // ... omitted for brevity addVolume( name: string, driver?: string, external?: boolean, configure?: callback): ComposeFile;}Signature
method
addVolume Adds a top-level volume definition to the Docker Compose file.
addVolume(name: string, driver?: string, external?: boolean, configure?: (obj: Volume) => Promise<void>): ComposeFileParameters
namestringThe name of the volume.driverstringoptionalThe volume driver to use.externalbooleanoptionalA value indicating whether the volume is managed outside the generated Compose file.configure(obj: Volume) => Promise<void> optionalAn optional callback for further volume customization.Returns
ComposeFile Applies to
This method applies to the following types: