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