Config configuration for the Compose application.
Name of an environment variable from which to get the config value.
Driver to use for templating the config's value.
null | close({
{
[=~"^x-" & !~"^(mode|endpoint_mode|replicas|labels|rollback_config|update_config|resources|restart_policy|placement)$"]: _
}
mode?: string
endpoint_mode?: string
replicas?: int | string
labels?: #list_or_dict
rollback_config?: close({
{
[=~"^x-" & !~"^(parallelism|delay|failure_action|monitor|max_failure_ratio|order)$"]: _
}
parallelism?: int | string
delay?: string
failure_action?: string
monitor?: string
max_failure_ratio?: number | string
order?: "start-first" | "stop-first"
})
update_config?: close({
{
[=~"^x-" & !~"^(parallelism|delay|failure_action|monitor|max_failure_ratio|order)$"]: _
}
parallelism?: int | string
delay?: string
failure_action?: string
monitor?: string
max_failure_ratio?: number | string
order?: "start-first" | "stop-first"
})
resources?: close({
{
[=~"^x-" & !~"^(limits|reservations)$"]: _
}
limits?: close({
{
[=~"^x-" & !~"^(cpus|memory|pids)$"]: _
}
cpus?: number | string
memory?: string
pids?: int | string
})
reservations?: close({
{
[=~"^x-" & !~"^(cpus|memory|generic_resources|devices)$"]: _
}
cpus?: number | string
memory?: string
generic_resources?: #generic_resources
devices?: #devices
})
})
restart_policy?: close({
{
[=~"^x-" & !~"^(condition|delay|max_attempts|window)$"]: _
}
condition?: string
delay?: string
max_attempts?: int | string
window?: string
})
placement?: close({
{
[=~"^x-" & !~"^(constraints|preferences|max_replicas_per_node)$"]: _
}
constraints?: [...string]
preferences?: [...close({
{
[=~"^x-" & !~"^(spread)$"]: _
}
spread?: string
})]
max_replicas_per_node?: int | string
})
})Deployment configuration for the service.
null | close({
{
[=~"^x-" & !~"^(watch)$"]: _
}
watch?: [...close({
{
[=~"^x-" & !~"^(ignore|include|path|action|target|exec|initial_sync)$"]: _
}
ignore?: #string_or_list
include?: #string_or_list
path!: string
action!: "rebuild" | "sync" | "restart" | "sync+restart" | "sync+exec"
target?: string
exec?: #service_hook
initial_sync?: bool
})]
})Development configuration for the service, used for development workflows.
[...close({
{
[=~"^x-" & !~"^(capabilities|count|device_ids|driver|options)$"]: _
}
capabilities!: #list_of_strings
count?: int | string
device_ids?: #list_of_strings
driver?: string
options?: #list_or_dict
})]Device reservations for containers, allowing services to access specific hardware devices.
Additional hostnames to be defined in the container's /etc/hosts file.
[...close({
{
[=~"^x-" & !~"^(discrete_resource_spec)$"]: _
}
discrete_resource_spec?: close({
{
[=~"^x-" & !~"^(kind|value)$"]: _
}
kind?: string
value?: number | string
})
})]User-defined resources for services, allowing services to reserve specialized hardware resources.
Configuration options to determine whether the container is healthy.
Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s.
Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value.
A list of unique string values.
Either a dictionary mapping keys to values, or a list of strings.
Language Model for the Compose application.
Raw runtime flags to pass to the inference engine.
null | close({
{
[=~"^x-" & !~"^(name|driver|driver_opts|ipam|external|internal|enable_ipv4|enable_ipv6|attachable|labels)$"]: _
}
name?: string
driver?: string
driver_opts?: {
{
[=~"^.+$"]: number | string
}
...
}
ipam?: close({
{
[=~"^x-" & !~"^(driver|config|options)$"]: _
}
driver?: string
config?: [...close({
{
[=~"^x-" & !~"^(subnet|ip_range|gateway|aux_addresses)$"]: _
}
subnet?: string
ip_range?: string
gateway?: string
aux_addresses?: close({
[=~"^.+$"]: string
})
})]
options?: close({
[=~"^.+$"]: string
})
})
external?: bool | string | close({
{
[=~"^x-" & !~"^(name)$"]: _
}
name?: string
})
internal?: bool | string
enable_ipv4?: bool | string
enable_ipv6?: bool | string
attachable?: bool | string
labels?: #list_or_dict
})Network configuration for the Compose application.
Secret configuration for the Compose application.
Name of an environment variable from which to get the secret value.
Specify driver-specific options.
Driver to use for templating the secret's value.
Configuration for a service.
matchN(1, [string, close({
{
[=~"^x-" & !~"^(context|dockerfile|dockerfile_inline|entitlements|args|ssh|labels|cache_from|cache_to|no_cache|additional_contexts|network|provenance|sbom|pull|target|shm_size|extra_hosts|isolation|privileged|secrets|tags|ulimits|platforms)$"]: _
}
context?: string
dockerfile?: string
dockerfile_inline?: string
entitlements?: [...string]
args?: #list_or_dict
ssh?: #list_or_dict
labels?: #list_or_dict
cache_from?: [...string]
cache_to?: [...string]
no_cache?: bool | string
additional_contexts?: #list_or_dict
network?: string
provenance?: bool | string
sbom?: bool | string
pull?: bool | string
target?: string
shm_size?: int | string
extra_hosts?: #extra_hosts
isolation?: string
privileged?: bool | string
secrets?: #service_config_or_secret
tags?: [...string]
ulimits?: #ulimits
platforms?: [...string]
})])Configuration options for building the service's image.
Block IO configuration for the service.
Limit read rate (bytes per second) from a device.
Limit read rate (IO per second) from a device.
Limit write rate (bytes per second) to a device.
Limit write rate (IO per second) to a device.
Block IO weight (relative weight) for specific devices.
Specify an optional parent cgroup for the container.
Specify a custom container name, rather than a generated default name.
Number of usable CPUs.
Percentage of CPU resources to use.
Limit the CPU CFS (Completely Fair Scheduler) quota.
Limit the CPU CFS (Completely Fair Scheduler) period.
Limit the CPU real-time period in microseconds or a duration.
Limit the CPU real-time runtime in microseconds or a duration.
matchN(1, [#list_of_strings, close({
[=~"^[a-zA-Z0-9._-]+$"]: close({
{
[=~"^x-" & !~"^(restart|required|condition)$"]: _
}
restart?: bool | string
required?: bool
condition!: "service_started" | "service_healthy" | "service_completed_successfully"
})
})])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.
Custom domain name to use for the service container.
Specify a service which will not be manage by Compose directly, and delegate its management to an external provider.
Link to services started outside this Compose application. Specify services as <service_name>:<alias>.
Add additional groups which user inside the container should be member of.
Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s.
Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value.
Container isolation technology to use. Supported values are platform-specific.
Container MAC address to set.
Memory limit for the container. A string value can use suffix like '2g' for 2 gigabytes.
Memory reservation for the container.
Container memory swappiness as percentage (0 to 100).
Amount of memory the container is allowed to swap to disk. Set to -1 to enable unlimited swap.
Network mode. Values can be 'bridge', 'host', 'none', 'service:[service name]', or 'container:[container name]'.
matchN(1, [#list_of_strings, close({
[=~"^[a-zA-Z0-9._-]+$"]: matchN(1, [close({
{
[=~"^x-" & !~"^(aliases|interface_name|ipv4_address|ipv6_address|link_local_ips|mac_address|driver_opts|priority|gw_priority)$"]: _
}
aliases?: #list_of_strings
interface_name?: string
ipv4_address?: string
ipv6_address?: string
link_local_ips?: #list_of_strings
mac_address?: string
driver_opts?: {
{
[=~"^.+$"]: number | string
}
...
}
priority?: number
gw_priority?: number
}), 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.
Disable OOM Killer for the container.
Tune host's OOM preferences for the container (accepts -1000 to 1000).
Tune a container's PIDs limit. Set to -1 for unlimited PIDs.
list.UniqueItems() & [...matchN(1, [number, string, close({
{
[=~"^x-" & !~"^(name|mode|host_ip|target|published|protocol|app_protocol)$"]: _
}
name?: string
mode?: string
host_ip?: string
target?: int | string
published?: int | string
protocol?: string
app_protocol?: string
})])]Expose container ports. Short format ([HOST:]CONTAINER[/PROTOCOL]).
Commands to run after the container starts. If any command fails, the container stops.
Give extended privileges to the service container.
Policy for pulling images. Options include: 'always', 'never', 'if_not_present', 'missing', 'build', or time-based refresh policies.
Time after which to refresh the image. Used with pull_policy=refresh.
Mount the container's filesystem as read only.
Override the default labeling scheme for each container.
Keep STDIN open even if not attached.
Time to wait for the container to stop gracefully before sending SIGKILL (e.g., '1s', '1m30s').
Signal to stop the container (e.g., 'SIGTERM', 'SIGINT').
Storage driver options for the container.
Bind mount Docker API socket and required auth.
User namespace to use. 'host' shares the host's user namespace.
list.UniqueItems() & [...matchN(1, [string, close({
{
[=~"^x-" & !~"^(type|source|target|read_only|consistency|bind|volume|tmpfs|image)$"]: _
}
type!: "bind" | "volume" | "tmpfs" | "cluster" | "npipe" | "image"
source?: string
target?: string
read_only?: bool | string
consistency?: string
bind?: close({
{
[=~"^x-" & !~"^(propagation|create_host_path|recursive|selinux)$"]: _
}
propagation?: string
create_host_path?: bool | string
recursive?: "enabled" | "disabled" | "writable" | "readonly"
selinux?: "z" | "Z"
})
volume?: close({
{
[=~"^x-" & !~"^(labels|nocopy|subpath)$"]: _
}
labels?: #list_or_dict
nocopy?: bool | string
subpath?: string
})
tmpfs?: close({
{
[=~"^x-" & !~"^(size|mode)$"]: _
}
size?: matchN(1, [int & >=0, string])
mode?: number | string
})
image?: close({
{
[=~"^x-" & !~"^(subpath)$"]: _
}
subpath?: string
})
})])]Mount host paths or named volumes accessible to the container. Short syntax (VOLUME:CONTAINER_PATH[:MODE])
Mount volumes from another service or container. Optionally specify read-only access (ro) or read-write (rw).
The working directory in which the entrypoint or command will be run
[...matchN(1, [string, close({
{
[=~"^x-" & !~"^(source|target|uid|gid|mode)$"]: _
}
source?: string
target?: string
uid?: string
gid?: string
mode?: number | string
})])]Configuration for service configs or secrets, defining how they are mounted in the container.
Configuration for service lifecycle hooks, which are commands executed at specific points in a container's lifecycle.
Whether to run the command with extended privileges.
Working directory for the command.
Either a single string or a list of strings.
null | close({
{
[=~"^x-" & !~"^(name|driver|driver_opts|external|labels)$"]: _
}
name?: string
driver?: string
driver_opts?: {
{
[=~"^.+$"]: number | string
}
...
}
external?: bool | string | close({
{
[=~"^x-" & !~"^(name)$"]: _
}
name?: string
})
labels?: #list_or_dict
})Volume configuration for the Compose application.
Compose Specification
The Compose file is a YAML file defining a multi-containers based application.