Type object
File match **/docker-compose.yml **/docker-compose.yaml **/docker-compose.*.yml **/docker-compose.*.yaml **/compose.yml **/compose.yaml **/compose.*.yml **/compose.*.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/docker-compose-yml/latest.json
Source https://raw.githubusercontent.com/compose-spec/compose-go/master/schema/compose-spec.json

Validate with Lintel

npx @lintel/lintel check
Type: object

The Compose file is a YAML file defining a multi-containers based application.

Properties

version string

declared for backward compatibility, ignored. Please remove it.

name string

define the Compose project name, until user defines one explicitly.

include include[]

compose sub-projects to be included.

services object

The services that will be used by your application.

models object

Language models that will be used by your application.

networks object

Networks that are shared among multiple services.

volumes object

Named volumes that are shared among multiple services.

secrets object

Secrets that are shared among multiple services.

configs object

Configurations that are shared among multiple services.

Definitions

service object

Configuration for a service.

develop object | null

Development configuration for the service, used for development workflows.

1 nested properties
watch object[]

Configure watch mode for the service, which monitors file changes and performs actions in response.

deploy object | null

Deployment configuration for the service.

9 nested properties
mode string

Deployment mode for the service: 'replicated' (default) or 'global'.

endpoint_mode string

Endpoint mode for the service: 'vip' (default) or 'dnsrr'.

replicas integer | string

Number of replicas of the service container to run.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

rollback_config object

Configuration for rolling back a service update.

6 nested properties
parallelism integer | string

The number of containers to rollback at a time. If set to 0, all containers rollback simultaneously.

delay string

The time to wait between each container group's rollback (e.g., '1s', '1m30s').

failure_action string

Action to take if a rollback fails: 'continue', 'pause'.

monitor string

Duration to monitor each task for failures after it is created (e.g., '1s', '1m30s').

max_failure_ratio number | string

Failure rate to tolerate during a rollback.

order string

Order of operations during rollbacks: 'stop-first' (default) or 'start-first'.

Values: "start-first" "stop-first"
update_config object

Configuration for updating a service.

6 nested properties
parallelism integer | string

The number of containers to update at a time.

delay string

The time to wait between updating a group of containers (e.g., '1s', '1m30s').

failure_action string

Action to take if an update fails: 'continue', 'pause', 'rollback'.

monitor string

Duration to monitor each updated task for failures after it is created (e.g., '1s', '1m30s').

max_failure_ratio number | string

Failure rate to tolerate during an update (0 to 1).

order string

Order of operations during updates: 'stop-first' (default) or 'start-first'.

Values: "start-first" "stop-first"
resources object

Resource constraints and reservations for the service.

2 nested properties
limits object

Resource limits for the service containers.

reservations object

Resource reservations for the service containers.

restart_policy object

Restart policy for the service containers.

4 nested properties
condition string

Condition for restarting the container: 'none', 'on-failure', 'any'.

delay string

Delay between restart attempts (e.g., '1s', '1m30s').

max_attempts integer | string

Maximum number of restart attempts before giving up.

window string

Time window used to evaluate the restart policy (e.g., '1s', '1m30s').

placement object

Constraints and preferences for the platform to select a physical node to run service containers

3 nested properties
constraints string[]

Placement constraints for the service (e.g., 'node.role==manager').

preferences object[]

Placement preferences for the service.

max_replicas_per_node integer | string

Maximum number of replicas of the service.

annotations object | string[]

Either a dictionary mapping keys to values, or a list of strings.

attach boolean | string
build string | object

Configuration options for building the service's image.

blkio_config object

Block IO configuration for the service.

6 nested properties
device_read_bps blkio_limit[]

Limit read rate (bytes per second) from a device.

device_read_iops blkio_limit[]

Limit read rate (IO per second) from a device.

device_write_bps blkio_limit[]

Limit write rate (bytes per second) to a device.

device_write_iops blkio_limit[]

Limit write rate (IO per second) to a device.

weight integer | string

Block IO weight (relative weight) for the service, between 10 and 1000.

weight_device blkio_weight[]

Block IO weight (relative weight) for specific devices.

cap_add string[]

Add Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'.

uniqueItems=true
cap_drop string[]

Drop Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'.

uniqueItems=true
cgroup string

Specify the cgroup namespace to join. Use 'host' to use the host's cgroup namespace, or 'private' to use a private cgroup namespace.

Values: "host" "private"
cgroup_parent string

Specify an optional parent cgroup for the container.

command null | string | string[]

Command to run in the container, which can be specified as a string (shell form) or array (exec form).

Configuration for service configs or secrets, defining how they are mounted in the container.

container_name string

Specify a custom container name, rather than a generated default name.

pattern=[a-zA-Z0-9][a-zA-Z0-9_.-]+
cpu_count string | integer

Number of usable CPUs.

cpu_percent string | integer

Percentage of CPU resources to use.

cpu_shares number | string

CPU shares (relative weight) for the container.

cpu_quota number | string

Limit the CPU CFS (Completely Fair Scheduler) quota.

cpu_period number | string

Limit the CPU CFS (Completely Fair Scheduler) period.

cpu_rt_period number | string

Limit the CPU real-time period in microseconds or a duration.

cpu_rt_runtime number | string

Limit the CPU real-time runtime in microseconds or a duration.

cpus number | string

Number of CPUs to use. A floating-point value is supported to request partial CPUs.

cpuset string

CPUs in which to allow execution (0-3, 0,1).

credential_spec object

Configure the credential spec for managed service account.

3 nested properties
config string

The name of the credential spec Config to use.

file string

Path to a credential spec file.

registry string

Path to a credential spec in the Windows registry.

depends_on list_of_strings | object

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 string[]

A list of unique string values.

uniqueItems=true
devices string | object[]

List of device mappings for the container.

dns string | list_of_strings

Either a single string or a list of strings.

dns_opt string[]

Custom DNS options to be passed to the container's DNS resolver.

uniqueItems=true
dns_search string | list_of_strings

Either a single string or a list of strings.

domainname string

Custom domain name to use for the service container.

entrypoint null | string | string[]

Command to run in the container, which can be specified as a string (shell form) or array (exec form).

env_file string | string | object[]
label_file string | string[]
environment object | string[]

Either a dictionary mapping keys to values, or a list of strings.

expose string | number[]

Expose ports without publishing them to the host machine - they'll only be accessible to linked services.

uniqueItems=true
extends string | object

Extend another service, in the current file or another file.

provider object

Specify a service which will not be manage by Compose directly, and delegate its management to an external provider.

2 nested properties
type string required

External component used by Compose to manage setup and teardown lifecycle of the service.

options object

Provider-specific options.

external_links string[]

Link to services started outside this Compose application. Specify services as <service_name>:.

uniqueItems=true
extra_hosts object | string[]

Additional hostnames to be defined in the container's /etc/hosts file.

gpus string | object[]
group_add string | number[]

Add additional groups which user inside the container should be member of.

uniqueItems=true
healthcheck object

Configuration options to determine whether the container is healthy.

7 nested properties
disable boolean | string

Disable any container-specified healthcheck. Set to true to disable.

interval string

Time between running the check (e.g., '1s', '1m30s'). Default: 30s.

retries number | string

Number of consecutive failures needed to consider the container as unhealthy. Default: 3.

test string | 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.

timeout string

Maximum time to allow one check to run (e.g., '1s', '1m30s'). Default: 30s.

start_period string

Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s.

start_interval string

Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value.

hostname string

Define a custom hostname for the service container.

image string

Specify the image to start the container from. Can be a repository/tag, a digest, or a local image ID.

init boolean | string

Run as an init process inside the container that forwards signals and reaps processes.

ipc 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.

isolation string

Container isolation technology to use. Supported values are platform-specific.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

links string[]

Link to containers in another service. Either specify both the service name and a link alias (SERVICE:ALIAS), or just the service name.

uniqueItems=true
logging object

Logging configuration for the service.

2 nested properties
driver string

Logging driver to use, such as 'json-file', 'syslog', 'journald', etc.

options object

Options for the logging driver.

mac_address string

Container MAC address to set.

mem_limit number | string

Memory limit for the container. A string value can use suffix like '2g' for 2 gigabytes.

mem_reservation string | integer

Memory reservation for the container.

mem_swappiness integer | string

Container memory swappiness as percentage (0 to 100).

memswap_limit number | string

Amount of memory the container is allowed to swap to disk. Set to -1 to enable unlimited swap.

network_mode string

Network mode. Values can be 'bridge', 'host', 'none', 'service:[service name]', or 'container:[container name]'.

models list_of_strings | object

AI Models to use, referencing entries under the top-level models key.

networks list_of_strings | object

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 boolean | string

Disable OOM Killer for the container.

oom_score_adj string | integer

Tune host's OOM preferences for the container (accepts -1000 to 1000).

pid string | null

PID mode for container.

pids_limit number | string

Tune a container's PIDs limit. Set to -1 for unlimited PIDs.

platform string

Target platform to run on, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'.

ports number | string | object[]

Expose container ports. Short format ([HOST:]CONTAINER[/PROTOCOL]).

uniqueItems=true
post_start service_hook[]

Commands to run after the container starts. If any command fails, the container stops.

pre_stop service_hook[]

Commands to run before the container stops. If any command fails, the container stop is aborted.

privileged boolean | string

Give extended privileges to the service container.

profiles string[]

A list of unique string values.

uniqueItems=true
pull_policy string

Policy for pulling images. Options include: 'always', 'never', 'if_not_present', 'missing', 'build', or time-based refresh policies.

pattern=always|never|build|if_not_present|missing|refresh|daily|weekly|every_([0-9]+[wdhms])+
pull_refresh_after string

Time after which to refresh the image. Used with pull_policy=refresh.

read_only boolean | string

Mount the container's filesystem as read only.

restart string

Restart policy for the service container. Options include: 'no', 'always', 'on-failure', and 'unless-stopped'.

runtime string

Runtime to use for this container, e.g., 'runc'.

scale integer | string

Number of containers to deploy for this service.

security_opt string[]

Override the default labeling scheme for each container.

uniqueItems=true
shm_size number | string

Size of /dev/shm. A string value can use suffix like '2g' for 2 gigabytes.

Configuration for service configs or secrets, defining how they are mounted in the container.

sysctls object | string[]

Either a dictionary mapping keys to values, or a list of strings.

stdin_open boolean | string

Keep STDIN open even if not attached.

stop_grace_period string

Time to wait for the container to stop gracefully before sending SIGKILL (e.g., '1s', '1m30s').

stop_signal string

Signal to stop the container (e.g., 'SIGTERM', 'SIGINT').

storage_opt object

Storage driver options for the container.

tmpfs string | list_of_strings

Either a single string or a list of strings.

tty boolean | string

Allocate a pseudo-TTY to service container.

ulimits object

Container ulimit options, controlling resource limits for processes inside the container.

use_api_socket boolean

Bind mount Docker API socket and required auth.

user string

Username or UID to run the container process as.

uts string

UTS namespace to use. 'host' shares the host's UTS namespace.

userns_mode string

User namespace to use. 'host' shares the host's user namespace.

volumes string | object[]

Mount host paths or named volumes accessible to the container. Short syntax (VOLUME:CONTAINER_PATH[:MODE])

uniqueItems=true
volumes_from string[]

Mount volumes from another service or container. Optionally specify read-only access (ro) or read-write (rw).

uniqueItems=true
working_dir string

The working directory in which the entrypoint or command will be run

healthcheck object

Configuration options to determine whether the container is healthy.

disable boolean | string

Disable any container-specified healthcheck. Set to true to disable.

interval string

Time between running the check (e.g., '1s', '1m30s'). Default: 30s.

retries number | string

Number of consecutive failures needed to consider the container as unhealthy. Default: 3.

test string | 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.

timeout string

Maximum time to allow one check to run (e.g., '1s', '1m30s'). Default: 30s.

start_period string

Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s.

start_interval string

Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value.

development object | null

Development configuration for the service, used for development workflows.

watch object[]

Configure watch mode for the service, which monitors file changes and performs actions in response.

deployment object | null

Deployment configuration for the service.

mode string

Deployment mode for the service: 'replicated' (default) or 'global'.

endpoint_mode string

Endpoint mode for the service: 'vip' (default) or 'dnsrr'.

replicas integer | string

Number of replicas of the service container to run.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

rollback_config object

Configuration for rolling back a service update.

6 nested properties
parallelism integer | string

The number of containers to rollback at a time. If set to 0, all containers rollback simultaneously.

delay string

The time to wait between each container group's rollback (e.g., '1s', '1m30s').

failure_action string

Action to take if a rollback fails: 'continue', 'pause'.

monitor string

Duration to monitor each task for failures after it is created (e.g., '1s', '1m30s').

max_failure_ratio number | string

Failure rate to tolerate during a rollback.

order string

Order of operations during rollbacks: 'stop-first' (default) or 'start-first'.

Values: "start-first" "stop-first"
update_config object

Configuration for updating a service.

6 nested properties
parallelism integer | string

The number of containers to update at a time.

delay string

The time to wait between updating a group of containers (e.g., '1s', '1m30s').

failure_action string

Action to take if an update fails: 'continue', 'pause', 'rollback'.

monitor string

Duration to monitor each updated task for failures after it is created (e.g., '1s', '1m30s').

max_failure_ratio number | string

Failure rate to tolerate during an update (0 to 1).

order string

Order of operations during updates: 'stop-first' (default) or 'start-first'.

Values: "start-first" "stop-first"
resources object

Resource constraints and reservations for the service.

2 nested properties
limits object

Resource limits for the service containers.

3 nested properties
cpus number | string

Limit for how much of the available CPU resources, as number of cores, a container can use.

memory string

Limit on the amount of memory a container can allocate (e.g., '1g', '1024m').

pids integer | string

Maximum number of PIDs available to the container.

reservations object

Resource reservations for the service containers.

4 nested properties
cpus number | string

Reservation for how much of the available CPU resources, as number of cores, a container can use.

memory string

Reservation on the amount of memory a container can allocate (e.g., '1g', '1024m').

generic_resources object[]

User-defined resources for services, allowing services to reserve specialized hardware resources.

devices object[]

Device reservations for containers, allowing services to access specific hardware devices.

restart_policy object

Restart policy for the service containers.

4 nested properties
condition string

Condition for restarting the container: 'none', 'on-failure', 'any'.

delay string

Delay between restart attempts (e.g., '1s', '1m30s').

max_attempts integer | string

Maximum number of restart attempts before giving up.

window string

Time window used to evaluate the restart policy (e.g., '1s', '1m30s').

placement object

Constraints and preferences for the platform to select a physical node to run service containers

3 nested properties
constraints string[]

Placement constraints for the service (e.g., 'node.role==manager').

preferences object[]

Placement preferences for the service.

max_replicas_per_node integer | string

Maximum number of replicas of the service.

generic_resources object[]

User-defined resources for services, allowing services to reserve specialized hardware resources.

devices object[]

Device reservations for containers, allowing services to access specific hardware devices.

gpus string | object[]
include string | object

Compose application or sub-projects to be included.

network object | null

Network configuration for the Compose application.

name string

Custom name for this network.

driver string

Specify which driver should be used for this network. Default is 'bridge'.

driver_opts object

Specify driver-specific options defined as key/value pairs.

ipam object

Custom IP Address Management configuration for this network.

3 nested properties
driver string

Custom IPAM driver, instead of the default.

config object[]

List of IPAM configuration blocks.

options object

Driver-specific options for the IPAM driver.

external boolean | string | object

Specifies that this network already exists and was created outside of Compose.

1 nested properties
name string

Specifies the name of the external network. Deprecated: use the 'name' property instead.

internal boolean | string

Create an externally isolated network.

enable_ipv4 boolean | string

Enable IPv4 networking.

enable_ipv6 boolean | string

Enable IPv6 networking.

attachable boolean | string

If true, standalone containers can attach to this network.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

volume object | null

Volume configuration for the Compose application.

name string

Custom name for this volume.

driver string

Specify which volume driver should be used for this volume.

driver_opts object

Specify driver-specific options.

external boolean | string | object

Specifies that this volume already exists and was created outside of Compose.

1 nested properties
name string

Specifies the name of the external volume. Deprecated: use the 'name' property instead.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

secret object

Secret configuration for the Compose application.

name string

Custom name for this secret.

environment string

Name of an environment variable from which to get the secret value.

file string

Path to a file containing the secret value.

external boolean | string | object

Specifies that this secret already exists and was created outside of Compose.

1 nested properties
name string

Specifies the name of the external secret.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

driver string

Specify which secret driver should be used for this secret.

driver_opts object

Specify driver-specific options.

template_driver string

Driver to use for templating the secret's value.

config object

Config configuration for the Compose application.

name string

Custom name for this config.

content string

Inline content of the config.

environment string

Name of an environment variable from which to get the config value.

file string

Path to a file containing the config value.

external boolean | string | object

Specifies that this config already exists and was created outside of Compose.

1 nested properties
name string

Specifies the name of the external config. Deprecated: use the 'name' property instead.

labels object | string[]

Either a dictionary mapping keys to values, or a list of strings.

template_driver string

Driver to use for templating the config's value.

model object

Language Model for the Compose application.

model string required

Language Model to run.

name string

Custom name for this model.

context_size integer
runtime_flags string[]

Raw runtime flags to pass to the inference engine.

command null | string | string[]

Command to run in the container, which can be specified as a string (shell form) or array (exec form).

service_hook object

Configuration for service lifecycle hooks, which are commands executed at specific points in a container's lifecycle.

command null | string | string[] required

Command to run in the container, which can be specified as a string (shell form) or array (exec form).

user string

User to run the command as.

privileged boolean | string

Whether to run the command with extended privileges.

working_dir string

Working directory for the command.

environment object | string[]

Either a dictionary mapping keys to values, or a list of strings.

env_file string | string | object[]
label_file string | string[]
string_or_list string | list_of_strings

Either a single string or a list of strings.

list_of_strings string[]

A list of unique string values.

list_or_dict object | string[]

Either a dictionary mapping keys to values, or a list of strings.

extra_hosts object | string[]

Additional hostnames to be defined in the container's /etc/hosts file.

blkio_limit object

Block IO limit for a specific device.

path string

Path to the device (e.g., '/dev/sda').

rate integer | string

Rate limit in bytes per second or IO operations per second.

blkio_weight object

Block IO weight for a specific device.

path string

Path to the device (e.g., '/dev/sda').

weight integer | string

Relative weight for the device, between 10 and 1000.

service_config_or_secret string | object[]

Configuration for service configs or secrets, defining how they are mounted in the container.

ulimits object

Container ulimit options, controlling resource limits for processes inside the container.