UNPKG

@nasriya/orchestriq

Version:

A package to generate Docker files

35 lines (34 loc) 1.24 kB
import StackVolume from "./StackVolume.js"; class ServicesVolumesManager { #_container; #_volumes = {}; constructor(container) { this.#_container = container; } /** * Returns a record of all volumes in the container. * @returns {Record<string, StackVolume>} A record of all volumes in the container. */ get list() { return this.#_volumes; } /** * Creates a new volume and adds it to the container. * * @param volume The volume to define, which includes properties such as: * - name: The name of the volume. * - driver: The driver to use for the volume. * - driverOpts: Options specific to the driver. * - labels: Labels for the volume. * - mount: The mount path for the volume. * - size: The size of the volume. * - accessMode: The access mode for the volume (e.g., 'read-write'). * @returns {StackVolume} The created volume. */ create(volume) { const vol = new StackVolume(volume, this.#_container); this.#_volumes[vol.name] = vol; return vol; } } export default ServicesVolumesManager;