diff --git a/docs/api.md b/docs/api.md index 94b4b13c..44a1fef5 100644 --- a/docs/api.md +++ b/docs/api.md @@ -70,6 +70,7 @@ compose.upAll({ | `executablePath` | `string` | Path to docker-compose executable if not in `$PATH` | | `config` | `string \| string[]` | Custom yml file(s), relative to `cwd` | | `configAsString` | `string` | Configuration as string (ignores `config` if set) | +| `compose` | `ComposeSpecification` | Typed compose configuration object (converted to YAML internally) | | `log` | `boolean` | Enable console logging | | `composeOptions` | `string[] \| Array` | Options for all commands (e.g., `--verbose`) | | `commandOptions` | `string[] \| Array` | Options for specific command | @@ -89,3 +90,30 @@ compose.upAll({ commandOptions: ['--build', ['--timeout', '30']] }) ``` + +### Example with typed compose object + +Instead of using a YAML file, you can pass a typed `ComposeSpecification` object directly. This gives you full TypeScript autocompletion and type checking for the Docker Compose configuration. + +```typescript +import { upAll, ComposeSpecification } from 'docker-compose' + +const compose: ComposeSpecification = { + services: { + web: { + image: 'nginx:latest', + ports: ['8080:80'] + }, + db: { + image: 'postgres:16', + environment: { + POSTGRES_PASSWORD: 'secret' + } + } + } +} + +await upAll({ compose }) +``` + +The `ComposeSpecification` type is generated from the official [Compose Specification JSON Schema](https://github.com/compose-spec/compose-spec), so it covers all valid compose file options. diff --git a/package.json b/package.json index dadd0ee5..230eb688 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,9 @@ "ci": "yarn install --frozen-lockfile", "test": "npx vitest --dir test --test-timeout=30000", "lint": "eslint src/**/*.ts test/**/*.ts", - "build": "tsc", - "prepublishOnly": "tsc", + "generate:types": "json2ts schema/compose-spec.json src/compose-spec.d.ts", + "build": "yarn generate:types && tsc", + "prepublishOnly": "yarn generate:types && tsc", "release": "yarn build && standard-version" }, "repository": { @@ -94,6 +95,7 @@ "eslint-plugin-prettier": "^3.3.1", "eslint-watch": "^7.0.0", "husky": "^6.0.0", + "json-schema-to-typescript": "^15.0.4", "prettier": "^2.2.1", "standard-version": "9.5.0", "typescript": "^5.0.0", diff --git a/schema/NOTICE b/schema/NOTICE new file mode 100644 index 00000000..ab98fca1 --- /dev/null +++ b/schema/NOTICE @@ -0,0 +1,6 @@ +The file compose-spec.json is sourced from the Compose Specification project: +https://github.com/compose-spec/compose-go + +Copyright The Compose Specification Authors. +Licensed under the Apache License, Version 2.0. +See https://www.apache.org/licenses/LICENSE-2.0 diff --git a/schema/compose-spec.json b/schema/compose-spec.json new file mode 100644 index 00000000..462de285 --- /dev/null +++ b/schema/compose-spec.json @@ -0,0 +1,1912 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "$id": "compose_spec.json", + "type": "object", + "title": "Compose Specification", + "description": "The Compose file is a YAML file defining a multi-containers based application.", + + "properties": { + "version": { + "type": "string", + "deprecated": true, + "description": "declared for backward compatibility, ignored. Please remove it." + }, + + "name": { + "type": "string", + "description": "define the Compose project name, until user defines one explicitly." + }, + + "include": { + "type": "array", + "items": { + "$ref": "#/definitions/include" + }, + "description": "compose sub-projects to be included." + }, + + "services": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/service" + } + }, + "additionalProperties": false, + "description": "The services that will be used by your application." + }, + + "models": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/model" + } + }, + "description": "Language models that will be used by your application." + }, + + + "networks": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/network" + } + }, + "description": "Networks that are shared among multiple services." + }, + + "volumes": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/volume" + } + }, + "additionalProperties": false, + "description": "Named volumes that are shared among multiple services." + }, + + "secrets": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/secret" + } + }, + "additionalProperties": false, + "description": "Secrets that are shared among multiple services." + }, + + "configs": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/config" + } + }, + "additionalProperties": false, + "description": "Configurations that are shared among multiple services." + } + }, + + "patternProperties": {"^x-": {}}, + "additionalProperties": false, + + "definitions": { + + "service": { + "type": "object", + "description": "Configuration for a service.", + "properties": { + "develop": {"$ref": "#/definitions/development"}, + "deploy": {"$ref": "#/definitions/deployment"}, + "annotations": {"$ref": "#/definitions/list_or_dict"}, + "attach": {"type": ["boolean", "string"]}, + "build": { + "description": "Configuration options for building the service's image.", + "oneOf": [ + {"type": "string", "description": "Path to the build context. Can be a relative path or a URL."}, + { + "type": "object", + "properties": { + "context": {"type": "string", "description": "Path to the build context. Can be a relative path or a URL."}, + "dockerfile": {"type": "string", "description": "Name of the Dockerfile to use for building the image."}, + "dockerfile_inline": {"type": "string", "description": "Inline Dockerfile content to use instead of a Dockerfile from the build context."}, + "entitlements": {"type": "array", "items": {"type": "string"}, "description": "List of extra privileged entitlements to grant to the build process."}, + "args": {"$ref": "#/definitions/list_or_dict", "description": "Build-time variables, specified as a map or a list of KEY=VAL pairs."}, + "ssh": {"$ref": "#/definitions/list_or_dict", "description": "SSH agent socket or keys to expose to the build. Format is either a string or a list of 'default|[=|[,]]'."}, + "labels": {"$ref": "#/definitions/list_or_dict", "description": "Labels to apply to the built image."}, + "cache_from": {"type": "array", "items": {"type": "string"}, "description": "List of sources the image builder should use for cache resolution"}, + "cache_to": {"type": "array", "items": {"type": "string"}, "description": "Cache destinations for the build cache."}, + "no_cache": {"type": ["boolean", "string"], "description": "Do not use cache when building the image."}, + "no_cache_filter": {"$ref": "#/definitions/string_or_list", "description": "Do not use build cache for the specified stages."}, + "additional_contexts": {"$ref": "#/definitions/list_or_dict", "description": "Additional build contexts to use, specified as a map of name to context path or URL."}, + "network": {"type": "string", "description": "Network mode to use for the build. Options include 'default', 'none', 'host', or a network name."}, + "provenance": {"type": ["string","boolean"], "description": "Add a provenance attestation"}, + "sbom": {"type": ["string","boolean"], "description": "Add a SBOM attestation"}, + "pull": {"type": ["boolean", "string"], "description": "Always attempt to pull a newer version of the image."}, + "target": {"type": "string", "description": "Build stage to target in a multi-stage Dockerfile."}, + "shm_size": {"type": ["integer", "string"], "description": "Size of /dev/shm for the build container. A string value can use suffix like '2g' for 2 gigabytes."}, + "extra_hosts": {"$ref": "#/definitions/extra_hosts", "description": "Add hostname mappings for the build container."}, + "isolation": {"type": "string", "description": "Container isolation technology to use for the build process."}, + "privileged": {"type": ["boolean", "string"], "description": "Give extended privileges to the build container."}, + "secrets": {"$ref": "#/definitions/service_config_or_secret", "description": "Secrets to expose to the build. These are accessible at build-time."}, + "tags": {"type": "array", "items": {"type": "string"}, "description": "Additional tags to apply to the built image."}, + "ulimits": {"$ref": "#/definitions/ulimits", "description": "Override the default ulimits for the build container."}, + "platforms": {"type": "array", "items": {"type": "string"}, "description": "Platforms to build for, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'."} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + "blkio_config": { + "type": "object", + "description": "Block IO configuration for the service.", + "properties": { + "device_read_bps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device.", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "device_read_iops": { + "type": "array", + "description": "Limit read rate (IO per second) from a device.", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "device_write_bps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device.", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "device_write_iops": { + "type": "array", + "description": "Limit write rate (IO per second) to a device.", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "weight": { + "type": ["integer", "string"], + "description": "Block IO weight (relative weight) for the service, between 10 and 1000." + }, + "weight_device": { + "type": "array", + "description": "Block IO weight (relative weight) for specific devices.", + "items": {"$ref": "#/definitions/blkio_weight"} + } + }, + "additionalProperties": false + }, + "cap_add": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Add Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'." + }, + "cap_drop": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Drop Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'." + }, + "cgroup": { + "type": "string", + "enum": ["host", "private"], + "description": "Specify the cgroup namespace to join. Use 'host' to use the host's cgroup namespace, or 'private' to use a private cgroup namespace." + }, + "cgroup_parent": { + "type": "string", + "description": "Specify an optional parent cgroup for the container." + }, + "command": { + "$ref": "#/definitions/command", + "description": "Override the default command declared by the container image, for example 'CMD' in Dockerfile." + }, + "configs": { + "$ref": "#/definitions/service_config_or_secret", + "description": "Grant access to Configs on a per-service basis." + }, + "container_name": { + "type": "string", + "description": "Specify a custom container name, rather than a generated default name.", + "pattern": "[a-zA-Z0-9][a-zA-Z0-9_.-]+" + }, + "cpu_count": { + "oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": 0} + ], + "description": "Number of usable CPUs." + }, + "cpu_percent": { + "oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": 0, "maximum": 100} + ], + "description": "Percentage of CPU resources to use." + }, + "cpu_shares": { + "type": ["number", "string"], + "description": "CPU shares (relative weight) for the container." + }, + "cpu_quota": { + "type": ["number", "string"], + "description": "Limit the CPU CFS (Completely Fair Scheduler) quota." + }, + "cpu_period": { + "type": ["number", "string"], + "description": "Limit the CPU CFS (Completely Fair Scheduler) period." + }, + "cpu_rt_period": { + "type": ["number", "string"], + "description": "Limit the CPU real-time period in microseconds or a duration." + }, + "cpu_rt_runtime": { + "type": ["number", "string"], + "description": "Limit the CPU real-time runtime in microseconds or a duration." + }, + "cpus": { + "type": ["number", "string"], + "description": "Number of CPUs to use. A floating-point value is supported to request partial CPUs." + }, + "cpuset": { + "type": "string", + "description": "CPUs in which to allow execution (0-3, 0,1)." + }, + "credential_spec": { + "type": "object", + "description": "Configure the credential spec for managed service account.", + "properties": { + "config": { + "type": "string", + "description": "The name of the credential spec Config to use." + }, + "file": { + "type": "string", + "description": "Path to a credential spec file." + }, + "registry": { + "type": "string", + "description": "Path to a credential spec in the Windows registry." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "depends_on": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "type": "object", + "additionalProperties": false, + "patternProperties": {"^x-": {}}, + "properties": { + "restart": { + "type": ["boolean", "string"], + "description": "Whether to restart dependent services when this service is restarted." + }, + "required": { + "type": "boolean", + "default": true, + "description": "Whether the dependency is required for the dependent service to start." + }, + "condition": { + "type": "string", + "enum": ["service_started", "service_healthy", "service_completed_successfully"], + "description": "Condition to wait for. 'service_started' waits until the service has started, 'service_healthy' waits until the service is healthy (as defined by its healthcheck), 'service_completed_successfully' waits until the service has completed successfully." + } + }, + "required": ["condition"] + } + } + } + ], + "description": "Express dependency between services. Service dependencies cause services to be started in dependency order. The dependent service will wait for the dependency to be ready before starting." + }, + "device_cgroup_rules": { + "$ref": "#/definitions/list_of_strings", + "description": "Add rules to the cgroup allowed devices list." + }, + "devices": { + "type": "array", + "description": "List of device mappings for the container.", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "required": ["source"], + "properties": { + "source": { + "type": "string", + "description": "Path on the host to the device." + }, + "target": { + "type": "string", + "description": "Path in the container where the device will be mapped." + }, + "permissions": { + "type": "string", + "description": "Cgroup permissions for the device (rwm)." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + } + }, + "dns": { + "$ref": "#/definitions/string_or_list", + "description": "Custom DNS servers to set for the service container." + }, + "dns_opt": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Custom DNS options to be passed to the container's DNS resolver." + }, + "dns_search": { + "$ref": "#/definitions/string_or_list", + "description": "Custom DNS search domains to set on the service container." + }, + "domainname": { + "type": "string", + "description": "Custom domain name to use for the service container." + }, + "entrypoint": { + "$ref": "#/definitions/command", + "description": "Override the default entrypoint declared by the container image, for example 'ENTRYPOINT' in Dockerfile." + }, + "env_file": { + "$ref": "#/definitions/env_file", + "description": "Add environment variables from a file or multiple files. Can be a single file path or a list of file paths." + }, + "label_file": { + "$ref": "#/definitions/label_file", + "description": "Add metadata to containers using files containing Docker labels." + }, + "environment": { + "$ref": "#/definitions/list_or_dict", + "description": "Add environment variables. You can use either an array or a list of KEY=VAL pairs." + }, + "expose": { + "type": "array", + "items": { + "type": ["string", "number"] + }, + "uniqueItems": true, + "description": "Expose ports without publishing them to the host machine - they'll only be accessible to linked services." + }, + "extends": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "The name of the service to extend." + }, + "file": { + "type": "string", + "description": "The file path where the service to extend is defined." + } + }, + "required": ["service"], + "additionalProperties": false + } + ], + "description": "Extend another service, in the current file or another file." + }, + "provider": { + "type": "object", + "description": "Specify a service which will not be manage by Compose directly, and delegate its management to an external provider.", + "required": ["type"], + "properties": { + "type": { + "type": "string", + "description": "External component used by Compose to manage setup and teardown lifecycle of the service." + }, + "options": { + "type": "object", + "description": "Provider-specific options.", + "patternProperties": { + "^.+$": {"oneOf": [ + { "type": ["string", "number", "boolean"] }, + { "type": "array", "items": {"type": ["string", "number", "boolean"]}} + ]} + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "external_links": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Link to services started outside this Compose application. Specify services as :." + }, + "extra_hosts": { + "$ref": "#/definitions/extra_hosts", + "description": "Add hostname mappings to the container network interface configuration." + }, + "gpus": { + "$ref": "#/definitions/gpus", + "description": "Define GPU devices to use. Can be set to 'all' to use all GPUs, or a list of specific GPU devices." + }, + "group_add": { + "type": "array", + "items": { + "type": ["string", "number"] + }, + "uniqueItems": true, + "description": "Add additional groups which user inside the container should be member of." + }, + "healthcheck": { + "$ref": "#/definitions/healthcheck", + "description": "Configure a health check for the container to monitor its health status." + }, + "hostname": { + "type": "string", + "description": "Define a custom hostname for the service container." + }, + "image": { + "type": "string", + "description": "Specify the image to start the container from. Can be a repository/tag, a digest, or a local image ID." + }, + "init": { + "type": ["boolean", "string"], + "description": "Run as an init process inside the container that forwards signals and reaps processes." + }, + "ipc": { + "type": "string", + "description": "IPC sharing mode for the service container. Use 'host' to share the host's IPC namespace, 'service:[service_name]' to share with another service, or 'shareable' to allow other services to share this service's IPC namespace." + }, + "isolation": { + "type": "string", + "description": "Container isolation technology to use. Supported values are platform-specific." + }, + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Add metadata to containers using Docker labels. You can use either an array or a list." + }, + "links": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Link to containers in another service. Either specify both the service name and a link alias (SERVICE:ALIAS), or just the service name." + }, + "logging": { + "type": "object", + "description": "Logging configuration for the service.", + "properties": { + "driver": { + "type": "string", + "description": "Logging driver to use, such as 'json-file', 'syslog', 'journald', etc." + }, + "options": { + "type": "object", + "description": "Options for the logging driver.", + "patternProperties": { + "^.+$": {"type": ["string", "number", "null"]} + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "mac_address": { + "type": "string", + "description": "Container MAC address to set." + }, + "mem_limit": { + "type": ["number", "string"], + "description": "Memory limit for the container. A string value can use suffix like '2g' for 2 gigabytes." + }, + "mem_reservation": { + "type": ["string", "integer"], + "description": "Memory reservation for the container." + }, + "mem_swappiness": { + "type": ["integer", "string"], + "description": "Container memory swappiness as percentage (0 to 100)." + }, + "memswap_limit": { + "type": ["number", "string"], + "description": "Amount of memory the container is allowed to swap to disk. Set to -1 to enable unlimited swap." + }, + "network_mode": { + "type": "string", + "description": "Network mode. Values can be 'bridge', 'host', 'none', 'service:[service name]', or 'container:[container name]'." + }, + "models": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + {"type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "oneOf": [ + { + "type": "object", + "properties": { + "endpoint_var": { + "type": "string", + "description": "Environment variable set to AI model endpoint." + }, + "model_var": { + "type": "string", + "description": "Environment variable set to AI model name." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + {"type": "null"} + ] + } + } + } + ], + "description": "AI Models to use, referencing entries under the top-level models key." + }, + "networks": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "oneOf": [ + { + "type": "object", + "properties": { + "aliases": { + "$ref": "#/definitions/list_of_strings", + "description": "Alternative hostnames for this service on the network." + }, + "interface_name": { + "type": "string", + "description": "Interface network name used to connect to network" + }, + "ipv4_address": { + "type": "string", + "description": "Specify a static IPv4 address for this service on this network." + }, + "ipv6_address": { + "type": "string", + "description": "Specify a static IPv6 address for this service on this network." + }, + "link_local_ips": { + "$ref": "#/definitions/list_of_strings", + "description": "List of link-local IPs." + }, + "mac_address": { + "type": "string", + "description": "Specify a MAC address for this service on this network." + }, + "driver_opts": { + "type": "object", + "description": "Driver options for this network.", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "priority": { + "type": "number", + "description": "Specify the priority for the network connection." + }, + "gw_priority": { + "type": "number", + "description": "Specify the gateway priority for the network connection." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + {"type": "null"} + ] + } + }, + "additionalProperties": false + } + ], + "description": "Networks to join, referencing entries under the top-level networks key. Can be a list of network names or a mapping of network name to network configuration." + }, + "oom_kill_disable": { + "type": ["boolean", "string"], + "description": "Disable OOM Killer for the container." + }, + "oom_score_adj": { + "oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": -1000, "maximum": 1000} + ], + "description": "Tune host's OOM preferences for the container (accepts -1000 to 1000)." + }, + "pid": { + "type": ["string", "null"], + "description": "PID mode for container." + }, + "pids_limit": { + "type": ["number", "string"], + "description": "Tune a container's PIDs limit. Set to -1 for unlimited PIDs." + }, + "platform": { + "type": "string", + "description": "Target platform to run on, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'." + }, + "ports": { + "type": "array", + "description": "Expose container ports. Short format ([HOST:]CONTAINER[/PROTOCOL]).", + "items": { + "oneOf": [ + {"type": "number"}, + {"type": "string"}, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A human-readable name for this port mapping." + }, + "mode": { + "type": "string", + "description": "The port binding mode, either 'host' for publishing a host port or 'ingress' for load balancing." + }, + "host_ip": { + "type": "string", + "description": "The host IP to bind to." + }, + "target": { + "type": ["integer", "string"], + "description": "The port inside the container." + }, + "published": { + "type": ["string", "integer"], + "description": "The publicly exposed port." + }, + "protocol": { + "type": "string", + "description": "The port protocol (tcp or udp)." + }, + "app_protocol": { + "type": "string", + "description": "Application protocol to use with the port (e.g., http, https, mysql)." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + "uniqueItems": true + }, + "post_start": { + "type": "array", + "items": {"$ref": "#/definitions/service_hook"}, + "description": "Commands to run after the container starts. If any command fails, the container stops." + }, + "pre_stop": { + "type": "array", + "items": {"$ref": "#/definitions/service_hook"}, + "description": "Commands to run before the container stops. If any command fails, the container stop is aborted." + }, + "privileged": { + "type": ["boolean", "string"], + "description": "Give extended privileges to the service container." + }, + "profiles": { + "$ref": "#/definitions/list_of_strings", + "description": "List of profiles for this service. When profiles are specified, services are only started when the profile is activated." + }, + "pull_policy": { + "type": "string", + "pattern": "always|never|build|if_not_present|missing|refresh|daily|weekly|every_([0-9]+[wdhms])+", + "description": "Policy for pulling images. Options include: 'always', 'never', 'if_not_present', 'missing', 'build', or time-based refresh policies." + }, + "pull_refresh_after": { + "type": "string", + "description": "Time after which to refresh the image. Used with pull_policy=refresh." + }, + "read_only": { + "type": ["boolean", "string"], + "description": "Mount the container's filesystem as read only." + }, + "restart": { + "type": "string", + "description": "Restart policy for the service container. Options include: 'no', 'always', 'on-failure', and 'unless-stopped'." + }, + "runtime": { + "type": "string", + "description": "Runtime to use for this container, e.g., 'runc'." + }, + "scale": { + "type": ["integer", "string"], + "description": "Number of containers to deploy for this service." + }, + "security_opt": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Override the default labeling scheme for each container." + }, + "shm_size": { + "type": ["number", "string"], + "description": "Size of /dev/shm. A string value can use suffix like '2g' for 2 gigabytes." + }, + "secrets": { + "$ref": "#/definitions/service_config_or_secret", + "description": "Grant access to Secrets on a per-service basis." + }, + "sysctls": { + "$ref": "#/definitions/list_or_dict", + "description": "Kernel parameters to set in the container. You can use either an array or a list." + }, + "stdin_open": { + "type": ["boolean", "string"], + "description": "Keep STDIN open even if not attached." + }, + "stop_grace_period": { + "type": "string", + "description": "Time to wait for the container to stop gracefully before sending SIGKILL (e.g., '1s', '1m30s')." + }, + "stop_signal": { + "type": "string", + "description": "Signal to stop the container (e.g., 'SIGTERM', 'SIGINT')." + }, + "storage_opt": { + "type": "object", + "description": "Storage driver options for the container." + }, + "tmpfs": { + "$ref": "#/definitions/string_or_list", + "description": "Mount a temporary filesystem (tmpfs) into the container. Can be a single value or a list." + }, + "tty": { + "type": ["boolean", "string"], + "description": "Allocate a pseudo-TTY to service container." + }, + "ulimits": { + "$ref": "#/definitions/ulimits", + "description": "Override the default ulimits for a container." + }, + "use_api_socket": { + "type": "boolean", + "description": "Bind mount Docker API socket and required auth." + }, + "user": { + "type": "string", + "description": "Username or UID to run the container process as." + }, + "uts": { + "type": "string", + "description": "UTS namespace to use. 'host' shares the host's UTS namespace." + }, + "userns_mode": { + "type": "string", + "description": "User namespace to use. 'host' shares the host's user namespace." + }, + "volumes": { + "type": "array", + "description": "Mount host paths or named volumes accessible to the container. Short syntax (VOLUME:CONTAINER_PATH[:MODE])", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "type": "string", + "enum": ["bind", "volume", "tmpfs", "cluster", "npipe", "image"], + "description": "The mount type: bind for mounting host directories, volume for named volumes, tmpfs for temporary filesystems, cluster for cluster volumes, npipe for named pipes, or image for mounting from an image." + }, + "source": { + "type": "string", + "description": "The source of the mount, a path on the host for a bind mount, a docker image reference for an image mount, or the name of a volume defined in the top-level volumes key. Not applicable for a tmpfs mount." + }, + "target": { + "type": "string", + "description": "The path in the container where the volume is mounted." + }, + "read_only": { + "type": ["boolean", "string"], + "description": "Flag to set the volume as read-only." + }, + "consistency": { + "type": "string", + "description": "The consistency requirements for the mount. Available values are platform specific." + }, + "bind": { + "type": "object", + "description": "Configuration specific to bind mounts.", + "properties": { + "propagation": { + "type": "string", + "description": "The propagation mode for the bind mount: 'shared', 'slave', 'private', 'rshared', 'rslave', or 'rprivate'." + }, + "create_host_path": { + "type": ["boolean", "string"], + "description": "Create the host path if it doesn't exist." + }, + "recursive": { + "type": "string", + "enum": ["enabled", "disabled", "writable", "readonly"], + "description": "Recursively mount the source directory." + }, + "selinux": { + "type": "string", + "enum": ["z", "Z"], + "description": "SELinux relabeling options: 'z' for shared content, 'Z' for private unshared content." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "volume": { + "type": "object", + "description": "Configuration specific to volume mounts.", + "properties": { + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Labels to apply to the volume." + }, + "nocopy": { + "type": ["boolean", "string"], + "description": "Flag to disable copying of data from a container when a volume is created." + }, + "subpath": { + "type": "string", + "description": "Path within the volume to mount instead of the volume root." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "tmpfs": { + "type": "object", + "description": "Configuration specific to tmpfs mounts.", + "properties": { + "size": { + "oneOf": [ + {"type": "integer", "minimum": 0}, + {"type": "string"} + ], + "description": "Size of the tmpfs mount in bytes." + }, + "mode": { + "type": ["number", "string"], + "description": "File mode of the tmpfs in octal." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "image": { + "type": "object", + "description": "Configuration specific to image mounts.", + "properties": { + "subpath": { + "type": "string", + "description": "Path within the image to mount instead of the image root." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + "uniqueItems": true + }, + "volumes_from": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "description": "Mount volumes from another service or container. Optionally specify read-only access (ro) or read-write (rw)." + }, + "working_dir": { + "type": "string", + "description": "The working directory in which the entrypoint or command will be run" + } + }, + "patternProperties": {"^x-": {}}, + "additionalProperties": false + }, + + "healthcheck": { + "type": "object", + "description": "Configuration options to determine whether the container is healthy.", + "properties": { + "disable": { + "type": ["boolean", "string"], + "description": "Disable any container-specified healthcheck. Set to true to disable." + }, + "interval": { + "type": "string", + "description": "Time between running the check (e.g., '1s', '1m30s'). Default: 30s." + }, + "retries": { + "type": ["number", "string"], + "description": "Number of consecutive failures needed to consider the container as unhealthy. Default: 3." + }, + "test": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ], + "description": "The test to perform to check container health. Can be a string or a list. The first item is either NONE, CMD, or CMD-SHELL. If it's CMD, the rest of the command is exec'd. If it's CMD-SHELL, the rest is run in the shell." + }, + "timeout": { + "type": "string", + "description": "Maximum time to allow one check to run (e.g., '1s', '1m30s'). Default: 30s." + }, + "start_period": { + "type": "string", + "description": "Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s." + }, + "start_interval": { + "type": "string", + "description": "Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "development": { + "type": ["object", "null"], + "description": "Development configuration for the service, used for development workflows.", + "properties": { + "watch": { + "type": "array", + "description": "Configure watch mode for the service, which monitors file changes and performs actions in response.", + "items": { + "type": "object", + "required": ["path", "action"], + "properties": { + "ignore": { + "$ref": "#/definitions/string_or_list", + "description": "Patterns to exclude from watching." + }, + "include": { + "$ref": "#/definitions/string_or_list", + "description": "Patterns to include in watching." + }, + "path": { + "type": "string", + "description": "Path to watch for changes." + }, + "action": { + "type": "string", + "enum": ["rebuild", "sync", "restart", "sync+restart", "sync+exec"], + "description": "Action to take when a change is detected: rebuild the container, sync files, restart the container, sync and restart, or sync and execute a command." + }, + "target": { + "type": "string", + "description": "Target path in the container for sync operations." + }, + "exec": { + "$ref": "#/definitions/service_hook", + "description": "Command to execute when a change is detected and action is sync+exec." + }, + "initial_sync": { + "type": "boolean", + "description": "Ensure that an initial synchronization is done before starting watch mode for sync+x triggers" + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "deployment": { + "type": ["object", "null"], + "description": "Deployment configuration for the service.", + "properties": { + "mode": { + "type": "string", + "description": "Deployment mode for the service: 'replicated' (default) or 'global'." + }, + "endpoint_mode": { + "type": "string", + "description": "Endpoint mode for the service: 'vip' (default) or 'dnsrr'." + }, + "replicas": { + "type": ["integer", "string"], + "description": "Number of replicas of the service container to run." + }, + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Labels to apply to the service." + }, + "rollback_config": { + "type": "object", + "description": "Configuration for rolling back a service update.", + "properties": { + "parallelism": { + "type": ["integer", "string"], + "description": "The number of containers to rollback at a time. If set to 0, all containers rollback simultaneously." + }, + "delay": { + "type": "string", + "description": "The time to wait between each container group's rollback (e.g., '1s', '1m30s')." + }, + "failure_action": { + "type": "string", + "description": "Action to take if a rollback fails: 'continue', 'pause'." + }, + "monitor": { + "type": "string", + "description": "Duration to monitor each task for failures after it is created (e.g., '1s', '1m30s')." + }, + "max_failure_ratio": { + "type": ["number", "string"], + "description": "Failure rate to tolerate during a rollback." + }, + "order": { + "type": "string", + "enum": ["start-first", "stop-first"], + "description": "Order of operations during rollbacks: 'stop-first' (default) or 'start-first'." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "update_config": { + "type": "object", + "description": "Configuration for updating a service.", + "properties": { + "parallelism": { + "type": ["integer", "string"], + "description": "The number of containers to update at a time." + }, + "delay": { + "type": "string", + "description": "The time to wait between updating a group of containers (e.g., '1s', '1m30s')." + }, + "failure_action": { + "type": "string", + "description": "Action to take if an update fails: 'continue', 'pause', 'rollback'." + }, + "monitor": { + "type": "string", + "description": "Duration to monitor each updated task for failures after it is created (e.g., '1s', '1m30s')." + }, + "max_failure_ratio": { + "type": ["number", "string"], + "description": "Failure rate to tolerate during an update (0 to 1)." + }, + "order": { + "type": "string", + "enum": ["start-first", "stop-first"], + "description": "Order of operations during updates: 'stop-first' (default) or 'start-first'." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "resources": { + "type": "object", + "description": "Resource constraints and reservations for the service.", + "properties": { + "limits": { + "type": "object", + "description": "Resource limits for the service containers.", + "properties": { + "cpus": { + "type": ["number", "string"], + "description": "Limit for how much of the available CPU resources, as number of cores, a container can use." + }, + "memory": { + "type": "string", + "description": "Limit on the amount of memory a container can allocate (e.g., '1g', '1024m')." + }, + "pids": { + "type": ["integer", "string"], + "description": "Maximum number of PIDs available to the container." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "reservations": { + "type": "object", + "description": "Resource reservations for the service containers.", + "properties": { + "cpus": { + "type": ["number", "string"], + "description": "Reservation for how much of the available CPU resources, as number of cores, a container can use." + }, + "memory": { + "type": "string", + "description": "Reservation on the amount of memory a container can allocate (e.g., '1g', '1024m')." + }, + "generic_resources": { + "$ref": "#/definitions/generic_resources", + "description": "User-defined resources to reserve." + }, + "devices": { + "$ref": "#/definitions/devices", + "description": "Device reservations for the container." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "restart_policy": { + "type": "object", + "description": "Restart policy for the service containers.", + "properties": { + "condition": { + "type": "string", + "description": "Condition for restarting the container: 'none', 'on-failure', 'any'." + }, + "delay": { + "type": "string", + "description": "Delay between restart attempts (e.g., '1s', '1m30s')." + }, + "max_attempts": { + "type": ["integer", "string"], + "description": "Maximum number of restart attempts before giving up." + }, + "window": { + "type": "string", + "description": "Time window used to evaluate the restart policy (e.g., '1s', '1m30s')." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "placement": { + "type": "object", + "description": "Constraints and preferences for the platform to select a physical node to run service containers", + "properties": { + "constraints": { + "type": "array", + "items": {"type": "string"}, + "description": "Placement constraints for the service (e.g., 'node.role==manager')." + }, + "preferences": { + "type": "array", + "description": "Placement preferences for the service.", + "items": { + "type": "object", + "properties": { + "spread": { + "type": "string", + "description": "Spread tasks evenly across values of the specified node label." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "max_replicas_per_node": { + "type": ["integer", "string"], + "description": "Maximum number of replicas of the service." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "generic_resources": { + "type": "array", + "description": "User-defined resources for services, allowing services to reserve specialized hardware resources.", + "items": { + "type": "object", + "properties": { + "discrete_resource_spec": { + "type": "object", + "description": "Specification for discrete (countable) resources.", + "properties": { + "kind": { + "type": "string", + "description": "Type of resource (e.g., 'GPU', 'FPGA', 'SSD')." + }, + "value": { + "type": ["number", "string"], + "description": "Number of resources of this kind to reserve." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + + "devices": { + "type": "array", + "description": "Device reservations for containers, allowing services to access specific hardware devices.", + "items": { + "type": "object", + "properties": { + "capabilities": { + "$ref": "#/definitions/list_of_strings", + "description": "List of capabilities the device needs to have (e.g., 'gpu', 'compute', 'utility')." + }, + "count": { + "type": ["string", "integer"], + "description": "Number of devices of this type to reserve." + }, + "device_ids": { + "$ref": "#/definitions/list_of_strings", + "description": "List of specific device IDs to reserve." + }, + "driver": { + "type": "string", + "description": "Device driver to use (e.g., 'nvidia')." + }, + "options": { + "$ref": "#/definitions/list_or_dict", + "description": "Driver-specific options for the device." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}}, + "required": [ + "capabilities" + ] + } + }, + + "gpus": { + "oneOf": [ + { + "type": "string", + "enum": ["all"], + "description": "Use all available GPUs." + }, + { + "type": "array", + "description": "List of specific GPU devices to use.", + "items": { + "type": "object", + "properties": { + "capabilities": { + "$ref": "#/definitions/list_of_strings", + "description": "List of capabilities the GPU needs to have (e.g., 'compute', 'utility')." + }, + "count": { + "type": ["string", "integer"], + "description": "Number of GPUs to use." + }, + "device_ids": { + "$ref": "#/definitions/list_of_strings", + "description": "List of specific GPU device IDs to use." + }, + "driver": { + "type": "string", + "description": "GPU driver to use (e.g., 'nvidia')." + }, + "options": { + "$ref": "#/definitions/list_or_dict", + "description": "Driver-specific options for the GPU." + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + + "include": { + "description": "Compose application or sub-projects to be included.", + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/string_or_list", + "description": "Path to the Compose application or sub-project files to include." + }, + "env_file": { + "$ref": "#/definitions/string_or_list", + "description": "Path to the environment files to use to define default values when interpolating variables in the Compose files being parsed." + }, + "project_directory": { + "type": "string", + "description": "Path to resolve relative paths set in the Compose file" + } + }, + "additionalProperties": false + } + ] + }, + + "network": { + "type": ["object", "null"], + "description": "Network configuration for the Compose application.", + "properties": { + "name": { + "type": "string", + "description": "Custom name for this network." + }, + "driver": { + "type": "string", + "description": "Specify which driver should be used for this network. Default is 'bridge'." + }, + "driver_opts": { + "type": "object", + "description": "Specify driver-specific options defined as key/value pairs.", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "ipam": { + "type": "object", + "description": "Custom IP Address Management configuration for this network.", + "properties": { + "driver": { + "type": "string", + "description": "Custom IPAM driver, instead of the default." + }, + "config": { + "type": "array", + "description": "List of IPAM configuration blocks.", + "items": { + "type": "object", + "properties": { + "subnet": { + "type": "string", + "description": "Subnet in CIDR format that represents a network segment." + }, + "ip_range": { + "type": "string", + "description": "Range of IPs from which to allocate container IPs." + }, + "gateway": { + "type": "string", + "description": "IPv4 or IPv6 gateway for the subnet." + }, + "aux_addresses": { + "type": "object", + "description": "Auxiliary IPv4 or IPv6 addresses used by Network driver.", + "additionalProperties": false, + "patternProperties": {"^.+$": {"type": "string"}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "options": { + "type": "object", + "description": "Driver-specific options for the IPAM driver.", + "additionalProperties": false, + "patternProperties": {"^.+$": {"type": "string"}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "external": { + "type": ["boolean", "string", "object"], + "description": "Specifies that this network already exists and was created outside of Compose.", + "properties": { + "name": { + "deprecated": true, + "type": "string", + "description": "Specifies the name of the external network. Deprecated: use the 'name' property instead." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "internal": { + "type": ["boolean", "string"], + "description": "Create an externally isolated network." + }, + "enable_ipv4": { + "type": ["boolean", "string"], + "description": "Enable IPv4 networking." + }, + "enable_ipv6": { + "type": ["boolean", "string"], + "description": "Enable IPv6 networking." + }, + "attachable": { + "type": ["boolean", "string"], + "description": "If true, standalone containers can attach to this network." + }, + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Add metadata to the network using labels." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "volume": { + "type": ["object", "null"], + "description": "Volume configuration for the Compose application.", + "properties": { + "name": { + "type": "string", + "description": "Custom name for this volume." + }, + "driver": { + "type": "string", + "description": "Specify which volume driver should be used for this volume." + }, + "driver_opts": { + "type": "object", + "description": "Specify driver-specific options.", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "external": { + "type": ["boolean", "string", "object"], + "description": "Specifies that this volume already exists and was created outside of Compose.", + "properties": { + "name": { + "deprecated": true, + "type": "string", + "description": "Specifies the name of the external volume. Deprecated: use the 'name' property instead." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Add metadata to the volume using labels." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "secret": { + "type": "object", + "description": "Secret configuration for the Compose application.", + "properties": { + "name": { + "type": "string", + "description": "Custom name for this secret." + }, + "environment": { + "type": "string", + "description": "Name of an environment variable from which to get the secret value." + }, + "file": { + "type": "string", + "description": "Path to a file containing the secret value." + }, + "external": { + "type": ["boolean", "string", "object"], + "description": "Specifies that this secret already exists and was created outside of Compose.", + "properties": { + "name": { + "type": "string", + "description": "Specifies the name of the external secret." + } + } + }, + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Add metadata to the secret using labels." + }, + "driver": { + "type": "string", + "description": "Specify which secret driver should be used for this secret." + }, + "driver_opts": { + "type": "object", + "description": "Specify driver-specific options.", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "template_driver": { + "type": "string", + "description": "Driver to use for templating the secret's value." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "config": { + "type": "object", + "description": "Config configuration for the Compose application.", + "properties": { + "name": { + "type": "string", + "description": "Custom name for this config." + }, + "content": { + "type": "string", + "description": "Inline content of the config." + }, + "environment": { + "type": "string", + "description": "Name of an environment variable from which to get the config value." + }, + "file": { + "type": "string", + "description": "Path to a file containing the config value." + }, + "external": { + "type": ["boolean", "string", "object"], + "description": "Specifies that this config already exists and was created outside of Compose.", + "properties": { + "name": { + "deprecated": true, + "type": "string", + "description": "Specifies the name of the external config. Deprecated: use the 'name' property instead." + } + } + }, + "labels": { + "$ref": "#/definitions/list_or_dict", + "description": "Add metadata to the config using labels." + }, + "template_driver": { + "type": "string", + "description": "Driver to use for templating the config's value." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "model": { + "type": "object", + "description": "Language Model for the Compose application.", + "properties": { + "name": { + "type": "string", + "description": "Custom name for this model." + }, + "model": { + "type": "string", + "description": "Language Model to run." + }, + "context_size": { + "type": "integer" + }, + "runtime_flags": { + "type": "array", + "items": {"type": "string"}, + "description": "Raw runtime flags to pass to the inference engine." + } + }, + "required": ["model"], + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "command": { + "oneOf": [ + { + "type": "null", + "description": "No command specified, use the container's default command." + }, + { + "type": "string", + "description": "Command as a string, which will be executed in a shell (e.g., '/bin/sh -c')." + }, + { + "type": "array", + "description": "Command as an array of strings, which will be executed directly without a shell.", + "items": { + "type": "string", + "description": "Part of the command (executable or argument)." + } + } + ], + "description": "Command to run in the container, which can be specified as a string (shell form) or array (exec form)." + }, + + "service_hook": { + "type": "object", + "description": "Configuration for service lifecycle hooks, which are commands executed at specific points in a container's lifecycle.", + "properties": { + "command": { + "$ref": "#/definitions/command", + "description": "Command to execute as part of the hook." + }, + "user": { + "type": "string", + "description": "User to run the command as." + }, + "privileged": { + "type": ["boolean", "string"], + "description": "Whether to run the command with extended privileges." + }, + "working_dir": { + "type": "string", + "description": "Working directory for the command." + }, + "environment": { + "$ref": "#/definitions/list_or_dict", + "description": "Environment variables for the command." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}}, + "required": ["command"] + }, + + "env_file": { + "oneOf": [ + { + "type": "string", + "description": "Path to a file containing environment variables." + }, + { + "type": "array", + "description": "List of paths to files containing environment variables.", + "items": { + "oneOf": [ + { + "type": "string", + "description": "Path to a file containing environment variables." + }, + { + "type": "object", + "description": "Detailed configuration for an environment file.", + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "description": "Path to the environment file." + }, + "format": { + "type": "string", + "description": "Format attribute lets you to use an alternative file formats for env_file. When not set, env_file is parsed according to Compose rules." + }, + "required": { + "type": ["boolean", "string"], + "default": true, + "description": "Whether the file is required. If true and the file doesn't exist, an error will be raised." + } + }, + "required": [ + "path" + ] + } + ] + } + } + ] + }, + + "label_file": { + "oneOf": [ + { + "type": "string", + "description": "Path to a file containing Docker labels." + }, + { + "type": "array", + "description": "List of paths to files containing Docker labels.", + "items": { + "type": "string", + "description": "Path to a file containing Docker labels." + } + } + ] + }, + + "string_or_list": { + "oneOf": [ + { + "type": "string", + "description": "A single string value." + }, + { + "$ref": "#/definitions/list_of_strings", + "description": "A list of string values." + } + ], + "description": "Either a single string or a list of strings." + }, + + "list_of_strings": { + "type": "array", + "description": "A list of unique string values.", + "items": { + "type": "string", + "description": "A string value in the list." + }, + "uniqueItems": true + }, + + "list_or_dict": { + "oneOf": [ + { + "type": "object", + "description": "A dictionary mapping keys to values.", + "patternProperties": { + ".+": { + "type": ["string", "number", "boolean", "null"], + "description": "Value for the key, which can be a string, number, boolean, or null." + } + }, + "additionalProperties": false + }, + { + "type": "array", + "description": "A list of unique string values.", + "items": { + "type": "string", + "description": "A string value in the list." + }, + "uniqueItems": true + } + ], + "description": "Either a dictionary mapping keys to values, or a list of strings." + }, + + "extra_hosts": { + "oneOf": [ + { + "type": "object", + "description": "list mapping hostnames to IP addresses.", + "patternProperties": { + ".+": { + "oneOf": [ + { + "type": "string", + "description": "IP address for the hostname." + }, + { + "type": "array", + "description": "List of IP addresses for the hostname.", + "items": { + "type": "string", + "description": "IP address for the hostname." + }, + "uniqueItems": false + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "array", + "description": "List of host:IP mappings in the format 'hostname:IP'.", + "items": { + "type": "string", + "description": "Host:IP mapping in the format 'hostname:IP'." + }, + "uniqueItems": true + } + ], + "description": "Additional hostnames to be defined in the container's /etc/hosts file." + }, + + "blkio_limit": { + "type": "object", + "description": "Block IO limit for a specific device.", + "properties": { + "path": { + "type": "string", + "description": "Path to the device (e.g., '/dev/sda')." + }, + "rate": { + "type": ["integer", "string"], + "description": "Rate limit in bytes per second or IO operations per second." + } + }, + "additionalProperties": false + }, + "blkio_weight": { + "type": "object", + "description": "Block IO weight for a specific device.", + "properties": { + "path": { + "type": "string", + "description": "Path to the device (e.g., '/dev/sda')." + }, + "weight": { + "type": ["integer", "string"], + "description": "Relative weight for the device, between 10 and 1000." + } + }, + "additionalProperties": false + }, + "service_config_or_secret": { + "type": "array", + "description": "Configuration for service configs or secrets, defining how they are mounted in the container.", + "items": { + "oneOf": [ + { + "type": "string", + "description": "Name of the config or secret to grant access to." + }, + { + "type": "object", + "description": "Detailed configuration for a config or secret.", + "properties": { + "source": { + "type": "string", + "description": "Name of the config or secret as defined in the top-level configs or secrets section." + }, + "target": { + "type": "string", + "description": "Path in the container where the config or secret will be mounted. Defaults to / for configs and /run/secrets/ for secrets." + }, + "uid": { + "type": "string", + "description": "UID of the file in the container. Default is 0 (root)." + }, + "gid": { + "type": "string", + "description": "GID of the file in the container. Default is 0 (root)." + }, + "mode": { + "type": ["number", "string"], + "description": "File permission mode inside the container, in octal. Default is 0444 for configs and 0400 for secrets." + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + } + }, + "ulimits": { + "type": "object", + "description": "Container ulimit options, controlling resource limits for processes inside the container.", + "patternProperties": { + "^[a-z]+$": { + "oneOf": [ + { + "type": ["integer", "string"], + "description": "Single value for both soft and hard limits." + }, + { + "type": "object", + "description": "Separate soft and hard limits.", + "properties": { + "hard": { + "type": ["integer", "string"], + "description": "Hard limit for the ulimit type. This is the maximum allowed value." + }, + "soft": { + "type": ["integer", "string"], + "description": "Soft limit for the ulimit type. This is the value that's actually enforced." + } + }, + "required": ["soft", "hard"], + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + } + } + } + } +} diff --git a/src/compose-spec.d.ts b/src/compose-spec.d.ts new file mode 100644 index 00000000..9be148dc --- /dev/null +++ b/src/compose-spec.d.ts @@ -0,0 +1,2543 @@ +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +/** + * Compose application or sub-projects to be included. + */ +export type Include = + | string + | { + /** + * Path to the Compose application or sub-project files to include. + */ + path?: string | ListOfStrings; + /** + * Path to the environment files to use to define default values when interpolating variables in the Compose files being parsed. + */ + env_file?: string | ListOfStrings; + /** + * Path to resolve relative paths set in the Compose file + */ + project_directory?: string; + }; +/** + * A list of string values. + */ +export type ListOfStrings = string[]; +/** + * Development configuration for the service, used for development workflows. + */ +export type Development = { + /** + * Configure watch mode for the service, which monitors file changes and performs actions in response. + */ + watch?: { + /** + * Patterns to exclude from watching. + */ + ignore?: string | ListOfStrings; + /** + * Patterns to include in watching. + */ + include?: string | ListOfStrings; + /** + * Path to watch for changes. + */ + path: string; + /** + * Action to take when a change is detected: rebuild the container, sync files, restart the container, sync and restart, or sync and execute a command. + */ + action: "rebuild" | "sync" | "restart" | "sync+restart" | "sync+exec"; + /** + * Target path in the container for sync operations. + */ + target?: string; + exec?: ServiceHook; + /** + * Ensure that an initial synchronization is done before starting watch mode for sync+x triggers + */ + initial_sync?: boolean; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} & Development1; +export type Development1 = { + /** + * Configure watch mode for the service, which monitors file changes and performs actions in response. + */ + watch?: { + /** + * Patterns to exclude from watching. + */ + ignore?: string | ListOfStrings; + /** + * Patterns to include in watching. + */ + include?: string | ListOfStrings; + /** + * Path to watch for changes. + */ + path: string; + /** + * Action to take when a change is detected: rebuild the container, sync files, restart the container, sync and restart, or sync and execute a command. + */ + action: "rebuild" | "sync" | "restart" | "sync+restart" | "sync+exec"; + /** + * Target path in the container for sync operations. + */ + target?: string; + exec?: ServiceHook; + /** + * Ensure that an initial synchronization is done before starting watch mode for sync+x triggers + */ + initial_sync?: boolean; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} | null; +/** + * Deployment configuration for the service. + */ +export type Deployment = { + /** + * Deployment mode for the service: 'replicated' (default) or 'global'. + */ + mode?: string; + /** + * Endpoint mode for the service: 'vip' (default) or 'dnsrr'. + */ + endpoint_mode?: string; + /** + * Number of replicas of the service container to run. + */ + replicas?: number | string; + /** + * Labels to apply to the service. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Configuration for rolling back a service update. + */ + rollback_config?: { + /** + * The number of containers to rollback at a time. If set to 0, all containers rollback simultaneously. + */ + parallelism?: number | string; + /** + * The time to wait between each container group's rollback (e.g., '1s', '1m30s'). + */ + delay?: string; + /** + * Action to take if a rollback fails: 'continue', 'pause'. + */ + failure_action?: string; + /** + * Duration to monitor each task for failures after it is created (e.g., '1s', '1m30s'). + */ + monitor?: string; + /** + * Failure rate to tolerate during a rollback. + */ + max_failure_ratio?: number | string; + /** + * Order of operations during rollbacks: 'stop-first' (default) or 'start-first'. + */ + order?: "start-first" | "stop-first"; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Configuration for updating a service. + */ + update_config?: { + /** + * The number of containers to update at a time. + */ + parallelism?: number | string; + /** + * The time to wait between updating a group of containers (e.g., '1s', '1m30s'). + */ + delay?: string; + /** + * Action to take if an update fails: 'continue', 'pause', 'rollback'. + */ + failure_action?: string; + /** + * Duration to monitor each updated task for failures after it is created (e.g., '1s', '1m30s'). + */ + monitor?: string; + /** + * Failure rate to tolerate during an update (0 to 1). + */ + max_failure_ratio?: number | string; + /** + * Order of operations during updates: 'stop-first' (default) or 'start-first'. + */ + order?: "start-first" | "stop-first"; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Resource constraints and reservations for the service. + */ + resources?: { + /** + * Resource limits for the service containers. + */ + limits?: { + /** + * Limit for how much of the available CPU resources, as number of cores, a container can use. + */ + cpus?: number | string; + /** + * Limit on the amount of memory a container can allocate (e.g., '1g', '1024m'). + */ + memory?: string; + /** + * Maximum number of PIDs available to the container. + */ + pids?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Resource reservations for the service containers. + */ + reservations?: { + /** + * Reservation for how much of the available CPU resources, as number of cores, a container can use. + */ + cpus?: number | string; + /** + * Reservation on the amount of memory a container can allocate (e.g., '1g', '1024m'). + */ + memory?: string; + generic_resources?: GenericResources; + devices?: Devices; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Restart policy for the service containers. + */ + restart_policy?: { + /** + * Condition for restarting the container: 'none', 'on-failure', 'any'. + */ + condition?: string; + /** + * Delay between restart attempts (e.g., '1s', '1m30s'). + */ + delay?: string; + /** + * Maximum number of restart attempts before giving up. + */ + max_attempts?: number | string; + /** + * Time window used to evaluate the restart policy (e.g., '1s', '1m30s'). + */ + window?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Constraints and preferences for the platform to select a physical node to run service containers + */ + placement?: { + /** + * Placement constraints for the service (e.g., 'node.role==manager'). + */ + constraints?: string[]; + /** + * Placement preferences for the service. + */ + preferences?: { + /** + * Spread tasks evenly across values of the specified node label. + */ + spread?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }[]; + /** + * Maximum number of replicas of the service. + */ + max_replicas_per_node?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} & Deployment1; +/** + * User-defined resources to reserve. + */ +export type GenericResources = { + /** + * Specification for discrete (countable) resources. + */ + discrete_resource_spec?: { + /** + * Type of resource (e.g., 'GPU', 'FPGA', 'SSD'). + */ + kind?: string; + /** + * Number of resources of this kind to reserve. + */ + value?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +}[]; +/** + * List of capabilities the device needs to have (e.g., 'gpu', 'compute', 'utility'). + */ +export type ListOfStrings1 = string[]; +/** + * List of specific device IDs to reserve. + */ +export type ListOfStrings2 = string[]; +/** + * Device reservations for the container. + */ +export type Devices = { + capabilities: ListOfStrings1; + /** + * Number of devices of this type to reserve. + */ + count?: string | number; + device_ids?: ListOfStrings2; + /** + * Device driver to use (e.g., 'nvidia'). + */ + driver?: string; + /** + * Driver-specific options for the device. + */ + options?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +}[]; +export type Deployment1 = { + /** + * Deployment mode for the service: 'replicated' (default) or 'global'. + */ + mode?: string; + /** + * Endpoint mode for the service: 'vip' (default) or 'dnsrr'. + */ + endpoint_mode?: string; + /** + * Number of replicas of the service container to run. + */ + replicas?: number | string; + /** + * Labels to apply to the service. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Configuration for rolling back a service update. + */ + rollback_config?: { + /** + * The number of containers to rollback at a time. If set to 0, all containers rollback simultaneously. + */ + parallelism?: number | string; + /** + * The time to wait between each container group's rollback (e.g., '1s', '1m30s'). + */ + delay?: string; + /** + * Action to take if a rollback fails: 'continue', 'pause'. + */ + failure_action?: string; + /** + * Duration to monitor each task for failures after it is created (e.g., '1s', '1m30s'). + */ + monitor?: string; + /** + * Failure rate to tolerate during a rollback. + */ + max_failure_ratio?: number | string; + /** + * Order of operations during rollbacks: 'stop-first' (default) or 'start-first'. + */ + order?: "start-first" | "stop-first"; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Configuration for updating a service. + */ + update_config?: { + /** + * The number of containers to update at a time. + */ + parallelism?: number | string; + /** + * The time to wait between updating a group of containers (e.g., '1s', '1m30s'). + */ + delay?: string; + /** + * Action to take if an update fails: 'continue', 'pause', 'rollback'. + */ + failure_action?: string; + /** + * Duration to monitor each updated task for failures after it is created (e.g., '1s', '1m30s'). + */ + monitor?: string; + /** + * Failure rate to tolerate during an update (0 to 1). + */ + max_failure_ratio?: number | string; + /** + * Order of operations during updates: 'stop-first' (default) or 'start-first'. + */ + order?: "start-first" | "stop-first"; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Resource constraints and reservations for the service. + */ + resources?: { + /** + * Resource limits for the service containers. + */ + limits?: { + /** + * Limit for how much of the available CPU resources, as number of cores, a container can use. + */ + cpus?: number | string; + /** + * Limit on the amount of memory a container can allocate (e.g., '1g', '1024m'). + */ + memory?: string; + /** + * Maximum number of PIDs available to the container. + */ + pids?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Resource reservations for the service containers. + */ + reservations?: { + /** + * Reservation for how much of the available CPU resources, as number of cores, a container can use. + */ + cpus?: number | string; + /** + * Reservation on the amount of memory a container can allocate (e.g., '1g', '1024m'). + */ + memory?: string; + generic_resources?: GenericResources; + devices?: Devices; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Restart policy for the service containers. + */ + restart_policy?: { + /** + * Condition for restarting the container: 'none', 'on-failure', 'any'. + */ + condition?: string; + /** + * Delay between restart attempts (e.g., '1s', '1m30s'). + */ + delay?: string; + /** + * Maximum number of restart attempts before giving up. + */ + max_attempts?: number | string; + /** + * Time window used to evaluate the restart policy (e.g., '1s', '1m30s'). + */ + window?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Constraints and preferences for the platform to select a physical node to run service containers + */ + placement?: { + /** + * Placement constraints for the service (e.g., 'node.role==manager'). + */ + constraints?: string[]; + /** + * Placement preferences for the service. + */ + preferences?: { + /** + * Spread tasks evenly across values of the specified node label. + */ + spread?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }[]; + /** + * Maximum number of replicas of the service. + */ + max_replicas_per_node?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} | null; +/** + * Either a dictionary mapping keys to values, or a list of strings. + */ +export type ListOrDict = + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; +/** + * Secrets to expose to the build. These are accessible at build-time. + */ +export type ServiceConfigOrSecret = ( + | string + | { + /** + * Name of the config or secret as defined in the top-level configs or secrets section. + */ + source?: string; + /** + * Path in the container where the config or secret will be mounted. Defaults to / for configs and /run/secrets/ for secrets. + */ + target?: string; + /** + * UID of the file in the container. Default is 0 (root). + */ + uid?: string; + /** + * GID of the file in the container. Default is 0 (root). + */ + gid?: string; + /** + * File permission mode inside the container, in octal. Default is 0444 for configs and 0400 for secrets. + */ + mode?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } +)[]; +/** + * Grant access to Configs on a per-service basis. + */ +export type ServiceConfigOrSecret1 = ( + | string + | { + /** + * Name of the config or secret as defined in the top-level configs or secrets section. + */ + source?: string; + /** + * Path in the container where the config or secret will be mounted. Defaults to / for configs and /run/secrets/ for secrets. + */ + target?: string; + /** + * UID of the file in the container. Default is 0 (root). + */ + uid?: string; + /** + * GID of the file in the container. Default is 0 (root). + */ + gid?: string; + /** + * File permission mode inside the container, in octal. Default is 0444 for configs and 0400 for secrets. + */ + mode?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } +)[]; +/** + * A list of unique string values. + */ +export type ListOfStrings3 = string[]; +/** + * A list of unique string values. + */ +export type ListOfStrings4 = string[]; +/** + * A list of unique string values. + */ +export type ListOfStrings5 = string[]; +/** + * A list of unique string values. + */ +export type ListOfStrings6 = string[]; +/** + * A list of unique string values. + */ +export type ListOfStrings7 = string[]; +/** + * A list of unique string values. + */ +export type ListOfStrings8 = string[]; +/** + * A list of unique string values. + */ +export type ListOfStrings9 = string[]; +/** + * Grant access to Secrets on a per-service basis. + */ +export type ServiceConfigOrSecret2 = ( + | string + | { + /** + * Name of the config or secret as defined in the top-level configs or secrets section. + */ + source?: string; + /** + * Path in the container where the config or secret will be mounted. Defaults to / for configs and /run/secrets/ for secrets. + */ + target?: string; + /** + * UID of the file in the container. Default is 0 (root). + */ + uid?: string; + /** + * GID of the file in the container. Default is 0 (root). + */ + gid?: string; + /** + * File permission mode inside the container, in octal. Default is 0444 for configs and 0400 for secrets. + */ + mode?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } +)[]; +/** + * Network configuration for the Compose application. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ +export type Network = { + /** + * Custom name for this network. + */ + name?: string; + /** + * Specify which driver should be used for this network. Default is 'bridge'. + */ + driver?: string; + /** + * Specify driver-specific options defined as key/value pairs. + */ + driver_opts?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number; + }; + /** + * Custom IP Address Management configuration for this network. + */ + ipam?: { + /** + * Custom IPAM driver, instead of the default. + */ + driver?: string; + /** + * List of IPAM configuration blocks. + */ + config?: { + /** + * Subnet in CIDR format that represents a network segment. + */ + subnet?: string; + /** + * Range of IPs from which to allocate container IPs. + */ + ip_range?: string; + /** + * IPv4 or IPv6 gateway for the subnet. + */ + gateway?: string; + /** + * Auxiliary IPv4 or IPv6 addresses used by Network driver. + */ + aux_addresses?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }[]; + /** + * Driver-specific options for the IPAM driver. + */ + options?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Specifies that this network already exists and was created outside of Compose. + */ + external?: + | boolean + | string + | { + /** + * @deprecated + * Specifies the name of the external network. Deprecated: use the 'name' property instead. + */ + name?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Create an externally isolated network. + */ + internal?: boolean | string; + /** + * Enable IPv4 networking. + */ + enable_ipv4?: boolean | string; + /** + * Enable IPv6 networking. + */ + enable_ipv6?: boolean | string; + /** + * If true, standalone containers can attach to this network. + */ + attachable?: boolean | string; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} & Network1; +export type Network1 = { + /** + * Custom name for this network. + */ + name?: string; + /** + * Specify which driver should be used for this network. Default is 'bridge'. + */ + driver?: string; + /** + * Specify driver-specific options defined as key/value pairs. + */ + driver_opts?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number; + }; + /** + * Custom IP Address Management configuration for this network. + */ + ipam?: { + /** + * Custom IPAM driver, instead of the default. + */ + driver?: string; + /** + * List of IPAM configuration blocks. + */ + config?: { + /** + * Subnet in CIDR format that represents a network segment. + */ + subnet?: string; + /** + * Range of IPs from which to allocate container IPs. + */ + ip_range?: string; + /** + * IPv4 or IPv6 gateway for the subnet. + */ + gateway?: string; + /** + * Auxiliary IPv4 or IPv6 addresses used by Network driver. + */ + aux_addresses?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }[]; + /** + * Driver-specific options for the IPAM driver. + */ + options?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Specifies that this network already exists and was created outside of Compose. + */ + external?: + | boolean + | string + | { + /** + * @deprecated + * Specifies the name of the external network. Deprecated: use the 'name' property instead. + */ + name?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Create an externally isolated network. + */ + internal?: boolean | string; + /** + * Enable IPv4 networking. + */ + enable_ipv4?: boolean | string; + /** + * Enable IPv6 networking. + */ + enable_ipv6?: boolean | string; + /** + * If true, standalone containers can attach to this network. + */ + attachable?: boolean | string; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} | null; +/** + * Volume configuration for the Compose application. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ +export type Volume = { + /** + * Custom name for this volume. + */ + name?: string; + /** + * Specify which volume driver should be used for this volume. + */ + driver?: string; + /** + * Specify driver-specific options. + */ + driver_opts?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number; + }; + /** + * Specifies that this volume already exists and was created outside of Compose. + */ + external?: + | boolean + | string + | { + /** + * @deprecated + * Specifies the name of the external volume. Deprecated: use the 'name' property instead. + */ + name?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} & Volume1; +export type Volume1 = { + /** + * Custom name for this volume. + */ + name?: string; + /** + * Specify which volume driver should be used for this volume. + */ + driver?: string; + /** + * Specify driver-specific options. + */ + driver_opts?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number; + }; + /** + * Specifies that this volume already exists and was created outside of Compose. + */ + external?: + | boolean + | string + | { + /** + * @deprecated + * Specifies the name of the external volume. Deprecated: use the 'name' property instead. + */ + name?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} | null; + +/** + * The Compose file is a YAML file defining a multi-containers based application. + */ +export interface ComposeSpecification { + /** + * @deprecated + * declared for backward compatibility, ignored. Please remove it. + */ + version?: string; + /** + * define the Compose project name, until user defines one explicitly. + */ + name?: string; + /** + * compose sub-projects to be included. + */ + include?: Include[]; + /** + * The services that will be used by your application. + */ + services?: { + [k: string]: Service; + }; + /** + * Language models that will be used by your application. + */ + models?: { + [k: string]: Model; + }; + /** + * Networks that are shared among multiple services. + */ + networks?: { + [k: string]: Network; + }; + /** + * Named volumes that are shared among multiple services. + */ + volumes?: { + [k: string]: Volume; + }; + /** + * Secrets that are shared among multiple services. + */ + secrets?: { + [k: string]: Secret; + }; + /** + * Configurations that are shared among multiple services. + */ + configs?: { + [k: string]: Config; + }; + /** + * This interface was referenced by `ComposeSpecification`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Configuration for a service. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ +export interface Service { + develop?: Development; + deploy?: Deployment; + annotations?: ListOrDict; + attach?: boolean | string; + /** + * Configuration options for building the service's image. + */ + build?: + | string + | { + /** + * Path to the build context. Can be a relative path or a URL. + */ + context?: string; + /** + * Name of the Dockerfile to use for building the image. + */ + dockerfile?: string; + /** + * Inline Dockerfile content to use instead of a Dockerfile from the build context. + */ + dockerfile_inline?: string; + /** + * List of extra privileged entitlements to grant to the build process. + */ + entitlements?: string[]; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + args?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + ssh?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * List of sources the image builder should use for cache resolution + */ + cache_from?: string[]; + /** + * Cache destinations for the build cache. + */ + cache_to?: string[]; + /** + * Do not use cache when building the image. + */ + no_cache?: boolean | string; + /** + * Do not use build cache for the specified stages. + */ + no_cache_filter?: string | ListOfStrings; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + additional_contexts?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Network mode to use for the build. Options include 'default', 'none', 'host', or a network name. + */ + network?: string; + /** + * Add a provenance attestation + */ + provenance?: string | boolean; + /** + * Add a SBOM attestation + */ + sbom?: string | boolean; + /** + * Always attempt to pull a newer version of the image. + */ + pull?: boolean | string; + /** + * Build stage to target in a multi-stage Dockerfile. + */ + target?: string; + /** + * Size of /dev/shm for the build container. A string value can use suffix like '2g' for 2 gigabytes. + */ + shm_size?: number | string; + /** + * Add hostname mappings for the build container. + */ + extra_hosts?: + | { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | string[]; + } + | string[]; + /** + * Container isolation technology to use for the build process. + */ + isolation?: string; + /** + * Give extended privileges to the build container. + */ + privileged?: boolean | string; + secrets?: ServiceConfigOrSecret; + /** + * Additional tags to apply to the built image. + */ + tags?: string[]; + ulimits?: Ulimits; + /** + * Platforms to build for, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'. + */ + platforms?: string[]; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Block IO configuration for the service. + */ + blkio_config?: { + /** + * Limit read rate (bytes per second) from a device. + */ + device_read_bps?: BlkioLimit[]; + /** + * Limit read rate (IO per second) from a device. + */ + device_read_iops?: BlkioLimit[]; + /** + * Limit write rate (bytes per second) to a device. + */ + device_write_bps?: BlkioLimit[]; + /** + * Limit write rate (IO per second) to a device. + */ + device_write_iops?: BlkioLimit[]; + /** + * Block IO weight (relative weight) for the service, between 10 and 1000. + */ + weight?: number | string; + /** + * Block IO weight (relative weight) for specific devices. + */ + weight_device?: BlkioWeight[]; + }; + /** + * Add Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'. + */ + cap_add?: string[]; + /** + * Drop Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'. + */ + cap_drop?: string[]; + /** + * Specify the cgroup namespace to join. Use 'host' to use the host's cgroup namespace, or 'private' to use a private cgroup namespace. + */ + cgroup?: "host" | "private"; + /** + * Specify an optional parent cgroup for the container. + */ + cgroup_parent?: string; + /** + * Override the default command declared by the container image, for example 'CMD' in Dockerfile. + */ + command?: null | string | string[]; + configs?: ServiceConfigOrSecret1; + /** + * Specify a custom container name, rather than a generated default name. + */ + container_name?: string; + /** + * Number of usable CPUs. + */ + cpu_count?: string | number; + /** + * Percentage of CPU resources to use. + */ + cpu_percent?: string | number; + /** + * CPU shares (relative weight) for the container. + */ + cpu_shares?: number | string; + /** + * Limit the CPU CFS (Completely Fair Scheduler) quota. + */ + cpu_quota?: number | string; + /** + * Limit the CPU CFS (Completely Fair Scheduler) period. + */ + cpu_period?: number | string; + /** + * Limit the CPU real-time period in microseconds or a duration. + */ + cpu_rt_period?: number | string; + /** + * Limit the CPU real-time runtime in microseconds or a duration. + */ + cpu_rt_runtime?: number | string; + /** + * Number of CPUs to use. A floating-point value is supported to request partial CPUs. + */ + cpus?: number | string; + /** + * CPUs in which to allow execution (0-3, 0,1). + */ + cpuset?: string; + /** + * Configure the credential spec for managed service account. + */ + credential_spec?: { + /** + * The name of the credential spec Config to use. + */ + config?: string; + /** + * Path to a credential spec file. + */ + file?: string; + /** + * Path to a credential spec in the Windows registry. + */ + registry?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Express dependency between services. Service dependencies cause services to be started in dependency order. The dependent service will wait for the dependency to be ready before starting. + */ + depends_on?: + | ListOfStrings3 + | { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ + [k: string]: { + /** + * Whether to restart dependent services when this service is restarted. + */ + restart?: boolean | string; + /** + * Whether the dependency is required for the dependent service to start. + */ + required?: boolean; + /** + * Condition to wait for. 'service_started' waits until the service has started, 'service_healthy' waits until the service is healthy (as defined by its healthcheck), 'service_completed_successfully' waits until the service has completed successfully. + */ + condition: "service_started" | "service_healthy" | "service_completed_successfully"; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + }; + device_cgroup_rules?: ListOfStrings4; + /** + * List of device mappings for the container. + */ + devices?: ( + | string + | { + /** + * Path on the host to the device. + */ + source: string; + /** + * Path in the container where the device will be mapped. + */ + target?: string; + /** + * Cgroup permissions for the device (rwm). + */ + permissions?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } + )[]; + /** + * Custom DNS servers to set for the service container. + */ + dns?: string | ListOfStrings; + /** + * Custom DNS options to be passed to the container's DNS resolver. + */ + dns_opt?: string[]; + /** + * Custom DNS search domains to set on the service container. + */ + dns_search?: string | ListOfStrings; + /** + * Custom domain name to use for the service container. + */ + domainname?: string; + /** + * Override the default entrypoint declared by the container image, for example 'ENTRYPOINT' in Dockerfile. + */ + entrypoint?: null | string | string[]; + /** + * Add environment variables from a file or multiple files. Can be a single file path or a list of file paths. + */ + env_file?: + | string + | ( + | string + | { + /** + * Path to the environment file. + */ + path: string; + /** + * Format attribute lets you to use an alternative file formats for env_file. When not set, env_file is parsed according to Compose rules. + */ + format?: string; + /** + * Whether the file is required. If true and the file doesn't exist, an error will be raised. + */ + required?: boolean | string; + } + )[]; + /** + * Add metadata to containers using files containing Docker labels. + */ + label_file?: string | string[]; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + environment?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Expose ports without publishing them to the host machine - they'll only be accessible to linked services. + */ + expose?: (string | number)[]; + /** + * Extend another service, in the current file or another file. + */ + extends?: + | string + | { + /** + * The name of the service to extend. + */ + service: string; + /** + * The file path where the service to extend is defined. + */ + file?: string; + }; + /** + * Specify a service which will not be manage by Compose directly, and delegate its management to an external provider. + */ + provider?: { + /** + * External component used by Compose to manage setup and teardown lifecycle of the service. + */ + type: string; + /** + * Provider-specific options. + */ + options?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: (string | number | boolean) | (string | number | boolean)[]; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Link to services started outside this Compose application. Specify services as :. + */ + external_links?: string[]; + /** + * Add hostname mappings to the container network interface configuration. + */ + extra_hosts?: + | { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | string[]; + } + | string[]; + /** + * Define GPU devices to use. Can be set to 'all' to use all GPUs, or a list of specific GPU devices. + */ + gpus?: + | "all" + | { + capabilities?: ListOfStrings5; + /** + * Number of GPUs to use. + */ + count?: string | number; + device_ids?: ListOfStrings6; + /** + * GPU driver to use (e.g., 'nvidia'). + */ + driver?: string; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + options?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + [k: string]: unknown; + }[]; + /** + * Add additional groups which user inside the container should be member of. + */ + group_add?: (string | number)[]; + healthcheck?: Healthcheck; + /** + * Define a custom hostname for the service container. + */ + hostname?: string; + /** + * Specify the image to start the container from. Can be a repository/tag, a digest, or a local image ID. + */ + image?: string; + /** + * Run as an init process inside the container that forwards signals and reaps processes. + */ + init?: boolean | string; + /** + * IPC sharing mode for the service container. Use 'host' to share the host's IPC namespace, 'service:[service_name]' to share with another service, or 'shareable' to allow other services to share this service's IPC namespace. + */ + ipc?: string; + /** + * Container isolation technology to use. Supported values are platform-specific. + */ + isolation?: string; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Link to containers in another service. Either specify both the service name and a link alias (SERVICE:ALIAS), or just the service name. + */ + links?: string[]; + /** + * Logging configuration for the service. + */ + logging?: { + /** + * Logging driver to use, such as 'json-file', 'syslog', 'journald', etc. + */ + driver?: string; + /** + * Options for the logging driver. + */ + options?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number | null; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Container MAC address to set. + */ + mac_address?: string; + /** + * Memory limit for the container. A string value can use suffix like '2g' for 2 gigabytes. + */ + mem_limit?: number | string; + /** + * Memory reservation for the container. + */ + mem_reservation?: string | number; + /** + * Container memory swappiness as percentage (0 to 100). + */ + mem_swappiness?: number | string; + /** + * Amount of memory the container is allowed to swap to disk. Set to -1 to enable unlimited swap. + */ + memswap_limit?: number | string; + /** + * Network mode. Values can be 'bridge', 'host', 'none', 'service:[service name]', or 'container:[container name]'. + */ + network_mode?: string; + /** + * AI Models to use, referencing entries under the top-level models key. + */ + models?: + | ListOfStrings3 + | { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ + [k: string]: { + /** + * Environment variable set to AI model endpoint. + */ + endpoint_var?: string; + /** + * Environment variable set to AI model name. + */ + model_var?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } | null; + }; + /** + * Networks to join, referencing entries under the top-level networks key. Can be a list of network names or a mapping of network name to network configuration. + */ + networks?: + | ListOfStrings3 + | { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ + [k: string]: { + aliases?: ListOfStrings7; + /** + * Interface network name used to connect to network + */ + interface_name?: string; + /** + * Specify a static IPv4 address for this service on this network. + */ + ipv4_address?: string; + /** + * Specify a static IPv6 address for this service on this network. + */ + ipv6_address?: string; + link_local_ips?: ListOfStrings8; + /** + * Specify a MAC address for this service on this network. + */ + mac_address?: string; + /** + * Driver options for this network. + */ + driver_opts?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number; + }; + /** + * Specify the priority for the network connection. + */ + priority?: number; + /** + * Specify the gateway priority for the network connection. + */ + gw_priority?: number; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } | null; + }; + /** + * Disable OOM Killer for the container. + */ + oom_kill_disable?: boolean | string; + /** + * Tune host's OOM preferences for the container (accepts -1000 to 1000). + */ + oom_score_adj?: string | number; + /** + * PID mode for container. + */ + pid?: string | null; + /** + * Tune a container's PIDs limit. Set to -1 for unlimited PIDs. + */ + pids_limit?: number | string; + /** + * Target platform to run on, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'. + */ + platform?: string; + /** + * Expose container ports. Short format ([HOST:]CONTAINER[/PROTOCOL]). + */ + ports?: ( + | number + | string + | { + /** + * A human-readable name for this port mapping. + */ + name?: string; + /** + * The port binding mode, either 'host' for publishing a host port or 'ingress' for load balancing. + */ + mode?: string; + /** + * The host IP to bind to. + */ + host_ip?: string; + /** + * The port inside the container. + */ + target?: number | string; + /** + * The publicly exposed port. + */ + published?: string | number; + /** + * The port protocol (tcp or udp). + */ + protocol?: string; + /** + * Application protocol to use with the port (e.g., http, https, mysql). + */ + app_protocol?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } + )[]; + /** + * Commands to run after the container starts. If any command fails, the container stops. + */ + post_start?: ServiceHook1[]; + /** + * Commands to run before the container stops. If any command fails, the container stop is aborted. + */ + pre_stop?: ServiceHook1[]; + /** + * Give extended privileges to the service container. + */ + privileged?: boolean | string; + profiles?: ListOfStrings9; + /** + * Policy for pulling images. Options include: 'always', 'never', 'if_not_present', 'missing', 'build', or time-based refresh policies. + */ + pull_policy?: string; + /** + * Time after which to refresh the image. Used with pull_policy=refresh. + */ + pull_refresh_after?: string; + /** + * Mount the container's filesystem as read only. + */ + read_only?: boolean | string; + /** + * Restart policy for the service container. Options include: 'no', 'always', 'on-failure', and 'unless-stopped'. + */ + restart?: string; + /** + * Runtime to use for this container, e.g., 'runc'. + */ + runtime?: string; + /** + * Number of containers to deploy for this service. + */ + scale?: number | string; + /** + * Override the default labeling scheme for each container. + */ + security_opt?: string[]; + /** + * Size of /dev/shm. A string value can use suffix like '2g' for 2 gigabytes. + */ + shm_size?: number | string; + secrets?: ServiceConfigOrSecret2; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + sysctls?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Keep STDIN open even if not attached. + */ + stdin_open?: boolean | string; + /** + * Time to wait for the container to stop gracefully before sending SIGKILL (e.g., '1s', '1m30s'). + */ + stop_grace_period?: string; + /** + * Signal to stop the container (e.g., 'SIGTERM', 'SIGINT'). + */ + stop_signal?: string; + /** + * Storage driver options for the container. + */ + storage_opt?: { + [k: string]: unknown; + }; + /** + * Mount a temporary filesystem (tmpfs) into the container. Can be a single value or a list. + */ + tmpfs?: string | ListOfStrings; + /** + * Allocate a pseudo-TTY to service container. + */ + tty?: boolean | string; + ulimits?: Ulimits1; + /** + * Bind mount Docker API socket and required auth. + */ + use_api_socket?: boolean; + /** + * Username or UID to run the container process as. + */ + user?: string; + /** + * UTS namespace to use. 'host' shares the host's UTS namespace. + */ + uts?: string; + /** + * User namespace to use. 'host' shares the host's user namespace. + */ + userns_mode?: string; + /** + * Mount host paths or named volumes accessible to the container. Short syntax (VOLUME:CONTAINER_PATH[:MODE]) + */ + volumes?: ( + | string + | { + /** + * The mount type: bind for mounting host directories, volume for named volumes, tmpfs for temporary filesystems, cluster for cluster volumes, npipe for named pipes, or image for mounting from an image. + */ + type: "bind" | "volume" | "tmpfs" | "cluster" | "npipe" | "image"; + /** + * The source of the mount, a path on the host for a bind mount, a docker image reference for an image mount, or the name of a volume defined in the top-level volumes key. Not applicable for a tmpfs mount. + */ + source?: string; + /** + * The path in the container where the volume is mounted. + */ + target?: string; + /** + * Flag to set the volume as read-only. + */ + read_only?: boolean | string; + /** + * The consistency requirements for the mount. Available values are platform specific. + */ + consistency?: string; + /** + * Configuration specific to bind mounts. + */ + bind?: { + /** + * The propagation mode for the bind mount: 'shared', 'slave', 'private', 'rshared', 'rslave', or 'rprivate'. + */ + propagation?: string; + /** + * Create the host path if it doesn't exist. + */ + create_host_path?: boolean | string; + /** + * Recursively mount the source directory. + */ + recursive?: "enabled" | "disabled" | "writable" | "readonly"; + /** + * SELinux relabeling options: 'z' for shared content, 'Z' for private unshared content. + */ + selinux?: "z" | "Z"; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Configuration specific to volume mounts. + */ + volume?: { + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Flag to disable copying of data from a container when a volume is created. + */ + nocopy?: boolean | string; + /** + * Path within the volume to mount instead of the volume root. + */ + subpath?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Configuration specific to tmpfs mounts. + */ + tmpfs?: { + /** + * Size of the tmpfs mount in bytes. + */ + size?: number | string; + /** + * File mode of the tmpfs in octal. + */ + mode?: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * Configuration specific to image mounts. + */ + image?: { + /** + * Path within the image to mount instead of the image root. + */ + subpath?: string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + } + )[]; + /** + * Mount volumes from another service or container. Optionally specify read-only access (ro) or read-write (rw). + */ + volumes_from?: string[]; + /** + * The working directory in which the entrypoint or command will be run + */ + working_dir?: string; + /** + * This interface was referenced by `Service`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Command to execute when a change is detected and action is sync+exec. + */ +export interface ServiceHook { + /** + * Command to execute as part of the hook. + */ + command: null | string | string[]; + /** + * User to run the command as. + */ + user?: string; + /** + * Whether to run the command with extended privileges. + */ + privileged?: boolean | string; + /** + * Working directory for the command. + */ + working_dir?: string; + /** + * Environment variables for the command. + */ + environment?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `ServiceHook`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `ServiceHook1`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Override the default ulimits for the build container. + */ +export interface Ulimits { + /** + * This interface was referenced by `Ulimits`'s JSON-Schema definition + * via the `patternProperty` "^[a-z]+$". + * + * This interface was referenced by `Ulimits1`'s JSON-Schema definition + * via the `patternProperty` "^[a-z]+$". + */ + [k: string]: + | (number | string) + | { + /** + * Hard limit for the ulimit type. This is the maximum allowed value. + */ + hard: number | string; + /** + * Soft limit for the ulimit type. This is the value that's actually enforced. + */ + soft: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; +} +/** + * Block IO limit for a specific device. + */ +export interface BlkioLimit { + /** + * Path to the device (e.g., '/dev/sda'). + */ + path?: string; + /** + * Rate limit in bytes per second or IO operations per second. + */ + rate?: number | string; +} +/** + * Block IO weight for a specific device. + */ +export interface BlkioWeight { + /** + * Path to the device (e.g., '/dev/sda'). + */ + path?: string; + /** + * Relative weight for the device, between 10 and 1000. + */ + weight?: number | string; +} +/** + * Configure a health check for the container to monitor its health status. + */ +export interface Healthcheck { + /** + * Disable any container-specified healthcheck. Set to true to disable. + */ + disable?: boolean | string; + /** + * Time between running the check (e.g., '1s', '1m30s'). Default: 30s. + */ + interval?: string; + /** + * Number of consecutive failures needed to consider the container as unhealthy. Default: 3. + */ + retries?: number | string; + /** + * The test to perform to check container health. Can be a string or a list. The first item is either NONE, CMD, or CMD-SHELL. If it's CMD, the rest of the command is exec'd. If it's CMD-SHELL, the rest is run in the shell. + */ + test?: string | string[]; + /** + * Maximum time to allow one check to run (e.g., '1s', '1m30s'). Default: 30s. + */ + timeout?: string; + /** + * Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s. + */ + start_period?: string; + /** + * Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value. + */ + start_interval?: string; + /** + * This interface was referenced by `Healthcheck`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Configuration for service lifecycle hooks, which are commands executed at specific points in a container's lifecycle. + */ +export interface ServiceHook1 { + /** + * Command to execute as part of the hook. + */ + command: null | string | string[]; + /** + * User to run the command as. + */ + user?: string; + /** + * Whether to run the command with extended privileges. + */ + privileged?: boolean | string; + /** + * Working directory for the command. + */ + working_dir?: string; + /** + * Environment variables for the command. + */ + environment?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * This interface was referenced by `ServiceHook`'s JSON-Schema definition + * via the `patternProperty` "^x-". + * + * This interface was referenced by `ServiceHook1`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Override the default ulimits for a container. + */ +export interface Ulimits1 { + /** + * This interface was referenced by `Ulimits`'s JSON-Schema definition + * via the `patternProperty` "^[a-z]+$". + * + * This interface was referenced by `Ulimits1`'s JSON-Schema definition + * via the `patternProperty` "^[a-z]+$". + */ + [k: string]: + | (number | string) + | { + /** + * Hard limit for the ulimit type. This is the maximum allowed value. + */ + hard: number | string; + /** + * Soft limit for the ulimit type. This is the value that's actually enforced. + */ + soft: number | string; + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; + }; +} +/** + * Language Model for the Compose application. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ +export interface Model { + /** + * Custom name for this model. + */ + name?: string; + /** + * Language Model to run. + */ + model: string; + context_size?: number; + /** + * Raw runtime flags to pass to the inference engine. + */ + runtime_flags?: string[]; + /** + * This interface was referenced by `Model`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Secret configuration for the Compose application. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ +export interface Secret { + /** + * Custom name for this secret. + */ + name?: string; + /** + * Name of an environment variable from which to get the secret value. + */ + environment?: string; + /** + * Path to a file containing the secret value. + */ + file?: string; + /** + * Specifies that this secret already exists and was created outside of Compose. + */ + external?: + | boolean + | string + | { + /** + * Specifies the name of the external secret. + */ + name?: string; + [k: string]: unknown; + }; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Specify which secret driver should be used for this secret. + */ + driver?: string; + /** + * Specify driver-specific options. + */ + driver_opts?: { + /** + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^.+$". + */ + [k: string]: string | number; + }; + /** + * Driver to use for templating the secret's value. + */ + template_driver?: string; + /** + * This interface was referenced by `Secret`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} +/** + * Config configuration for the Compose application. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` "^[a-zA-Z0-9._-]+$". + */ +export interface Config { + /** + * Custom name for this config. + */ + name?: string; + /** + * Inline content of the config. + */ + content?: string; + /** + * Name of an environment variable from which to get the config value. + */ + environment?: string; + /** + * Path to a file containing the config value. + */ + file?: string; + /** + * Specifies that this config already exists and was created outside of Compose. + */ + external?: + | boolean + | string + | { + /** + * @deprecated + * Specifies the name of the external config. Deprecated: use the 'name' property instead. + */ + name?: string; + [k: string]: unknown; + }; + /** + * Either a dictionary mapping keys to values, or a list of strings. + */ + labels?: + | { + /** + * Value for the key, which can be a string, number, boolean, or null. + * + * This interface was referenced by `undefined`'s JSON-Schema definition + * via the `patternProperty` ".+". + */ + [k: string]: string | number | boolean | null; + } + | string[]; + /** + * Driver to use for templating the config's value. + */ + template_driver?: string; + /** + * This interface was referenced by `Config`'s JSON-Schema definition + * via the `patternProperty` "^x-". + */ + [k: string]: unknown; +} diff --git a/src/index.ts b/src/index.ts index 12fb4224..08edc538 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ import childProcess from 'child_process' import yaml from 'yaml' import mapPorts from './map-ports' +export type { ComposeSpecification } from './compose-spec' +import type { ComposeSpecification } from './compose-spec' export type IDockerComposeExecutableOptions = | { @@ -19,6 +21,7 @@ export interface IDockerComposeOptions { executable?: IDockerComposeExecutableOptions config?: string | string[] configAsString?: string + compose?: ComposeSpecification log?: boolean composeOptions?: string[] | (string | string[])[] commandOptions?: string[] | (string | string[])[] @@ -285,6 +288,10 @@ export const execCompose = ( options: IDockerComposeOptions = {} ): Promise => new Promise((resolve, reject): void => { + if (options.compose) { + options.configAsString = yaml.stringify(options.compose) + } + const composeOptions = options.composeOptions || [] const commandOptions = options.commandOptions || [] let composeArgs = composeOptionsToArgs(composeOptions) diff --git a/test/compose.test.ts b/test/compose.test.ts index fd82fa9c..99a957aa 100644 --- a/test/compose.test.ts +++ b/test/compose.test.ts @@ -549,6 +549,34 @@ describe('when using build config as string', (): void => { }) }) +describe('when using compose object', (): void => { + it('should start services from a typed compose object', async (): Promise => { + const config = { + compose: { + services: { + web: { + image: 'nginx:1.16.0', + container_name: 'compose_test_web_obj', + command: 'nginx -g "daemon off;"', + environment: { + NGINX_PORT: '8889' + }, + ports: ['8889:8889'] + } + } + }, + log: logOutput + } + + await compose.upAll(config) + const result = await compose.port('web', 8889, config) + + expect(result.data.address).toBe('0.0.0.0') + expect(result.data.port).toBe(8889) + await compose.downAll(config) + }) +}) + describe('when building single service', (): void => { it('should only build this service', async (): Promise => { const opts = { diff --git a/yarn.lock b/yarn.lock index a99c9480..aaa91655 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,15 @@ # yarn lockfile v1 +"@apidevtools/json-schema-ref-parser@^11.5.5": + version "11.9.3" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.9.3.tgz#0e0c9061fc41cf03737d499a4e6a8299fdd2bfa7" + integrity sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ== + dependencies: + "@jsdevtools/ono" "^7.1.3" + "@types/json-schema" "^7.0.15" + js-yaml "^4.1.0" + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -382,6 +391,11 @@ resolved "https://registry.yarnpkg.com/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw== +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + "@nodelib/fs.scandir@2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" @@ -628,6 +642,11 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== +"@types/json-schema@^7.0.15": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/json-schema@^7.0.3": version "7.0.4" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" @@ -638,6 +657,11 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/lodash@^4.17.7": + version "4.17.24" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.24.tgz#4ae334fc62c0e915ca8ed8e35dcc6d4eeb29215f" + integrity sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ== + "@types/minimist@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6" @@ -2464,6 +2488,13 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" @@ -2578,6 +2609,21 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-schema-to-typescript@^15.0.4: + version "15.0.4" + resolved "https://registry.yarnpkg.com/json-schema-to-typescript/-/json-schema-to-typescript-15.0.4.tgz#a530c7f17312503b262ae12233749732171840f3" + integrity sha512-Su9oK8DR4xCmDsLlyvadkXzX6+GGXJpbhwoLtOGArAG61dvbW4YQmSEno2y66ahpIdmLMg6YUf/QHLgiwvkrHQ== + dependencies: + "@apidevtools/json-schema-ref-parser" "^11.5.5" + "@types/json-schema" "^7.0.15" + "@types/lodash" "^4.17.7" + is-glob "^4.0.3" + js-yaml "^4.1.0" + lodash "^4.17.21" + minimist "^1.2.8" + prettier "^3.2.5" + tinyglobby "^0.2.9" + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3347,6 +3393,11 @@ prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== +prettier@^3.2.5: + version "3.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.8.1.tgz#edf48977cf991558f4fcbd8a3ba6015ba2a3a173" + integrity sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -4047,7 +4098,7 @@ tinyexec@^1.0.0, tinyexec@^1.0.2: resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.0.2.tgz#bdd2737fe2ba40bd6f918ae26642f264b99ca251" integrity sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg== -tinyglobby@^0.2.15: +tinyglobby@^0.2.15, tinyglobby@^0.2.9: version "0.2.15" resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==