Configure options below — the preview updates in real time.

Top-Level Elements

Root-level settings for the Docker Compose project file.

Legacy versioning string. The Compose Specification merges 2.x and 3.x. Generally omitted in modern files.

Sets the project name for the deployment. Defaults to the directory name.

Service: Build Configuration

Configuration options applied during image creation.

Path to the build context directory or a git repository URL.

Alternative Dockerfile name relative to the build context.

Inline raw Dockerfile instructions.

Build-time environment variables passed as key-value pairs.

SSH authentications available during the build (key=value pairs).

Images to use as cache sources during the build.

Cache export destinations.

Additional build contexts like local paths or images.

Metadata labels applied to the built image.

Network containers connect to during RUN instructions.

No CacheDisables image builder cache and enforces a full rebuild.
Always Pull on BuildAlways pull the base image when building.

Target build stage in a multi-stage Dockerfile.

Secrets available to the build process on a per-service basis.

Additional tags to apply to the built image.

Target architectures for multi-platform builds.

Privileged BuildBuild with elevated privileges.

Hostname-to-IP mappings injected during the build.

Shared memory size for build containers (e.g. 256m).

Container isolation technology (Windows-specific).

Extra privileged entitlements allowed during the build.

Service: Develop & Watch

Development environment syncing and file watch rules for live reloading.

File watch rules that trigger actions when source files change. Define as YAML array of objects with action, path, target, and ignore fields. Actions: rebuild, restart, sync, sync+restart, sync+exec.

Service: Core Container Execution

Primary settings for service image, command, restart policy, and container identity.

The Docker image to start the container from.

Custom name for the container.

Overrides the default CMD in the Dockerfile. Use tags for array syntax.

Overrides the default ENTRYPOINT in the Dockerfile.

Init ProcessRun an init process (PID 1) inside the container to forward signals and reap zombies.

Defines the container restart policy.

Optional service profiles (e.g. debug, test). Service only starts if profile is active.

Decides when to pull the service image.

AttachWhen set to false, Compose does not collect service logs until explicitly requested.

Number of container instances to launch (legacy; use deploy.replicas instead).

Time to wait before forcefully killing a stopped container.

Alternative signal to stop the container.

Overrides the working directory inside the container.

Metadata annotations for the container using reverse-DNS notation.

Metadata labels added to the container as key-value pairs.

Name of another service to inherit configuration from.

Path to another Compose file containing the service to extend.

Network links to containers in other services (SERVICE or SERVICE:ALIAS).

Links to containers managed outside this Compose application.

Service: Network & Ports

Port mapping, network modes, DNS, and hostname configuration.

Port mappings in HOST:CONTAINER format (e.g. 8080:80).

Expose ports to linked services without publishing to the host.

Networks the service connects to (list of network names).

Container networking mode (bridge, host, none, or service:name).

Custom DNS servers.

Custom DNS resolver options.

Custom DNS search domains.

Additional hostname-to-IP mappings added to /etc/hosts.

Sets the container MAC address.

Sets the container hostname.

Sets the container domain name.

Service: Storage & Volumes

Volume mounts, tmpfs mounts, and volumes_from configuration.

Volume mounts in SOURCE:TARGET[:MODE] format.

Mount all volumes from another service or container.

Mount temporary file systems inside the container.

Service: Environment, Configs & Secrets

Environment variables, env files, configs, and secrets for the service.

Key-value pairs of environment variables for the container.

Path(s) to .env files to load into the container.

Config objects granted to this service (short syntax: list of config names).

Secret objects granted to this service (short syntax: list of secret names).

Service: Health, Dependencies & Lifecycle

Health checks, dependency ordering, lifecycle hooks, and container lifecycle settings.

Services that must start before this service (simple list).

The command to run for health checking (e.g. CMD curl -f http://localhost/).

Time between health checks.

Time to wait for a health check to complete.

Number of consecutive failures needed to mark unhealthy.

Initialization time before health checks start counting failures.

Time between health checks during the start period.

Disable HealthcheckDisable the healthcheck inherited from the image.

Service: Deploy & Orchestration

Swarm/orchestration settings including replicas, resource limits, and update strategies.

Service discovery mode for the service.

Container deployment mode.

Number of container instances to run.

Metadata labels for the deployed service.

Maximum CPU allocation (e.g. 0.5 for half a core).

Maximum memory allocation (e.g. 512M).

Maximum number of PIDs in the container.

Minimum CPU allocation reserved.

Minimum memory reserved.

Constraints for node placement (e.g. node.role==manager).

Placement preferences for distributing replicas (e.g. spread: node.labels.zone).

Limit the number of replicas on each swarm node.

Condition under which to restart after failure.

Delay between restart attempts.

Maximum number of restart attempts.

Time window to evaluate restart decisions.

Number of containers to update simultaneously.

Delay between updating each batch of containers.

Action to take if an update task fails.

Duration after each update to monitor for failure.

Maximum tolerated failure rate during an update (0.0 to 1.0).

Order of operations during updates.

Number of containers to roll back simultaneously.

Delay between rolling back each batch.

Action to take if a rollback task fails.

Duration after each rollback to monitor for failure.

Maximum tolerated failure rate during a rollback (0.0 to 1.0).

Order of operations during rollbacks.

Service: Security, Hardware & OS Limits

Privileged mode, capabilities, cgroup settings, device access, and resource limits.

Privileged ModeGrants the container root access to host devices.

Linux capabilities to add to the container.

Linux capabilities to drop from the container.

Cgroup namespace mode.

Optional parent cgroup for the container.

Path to a credential spec file for managed service accounts (Windows containers).

Registry reference for the credential spec (Windows containers).

List of device cgroup rules.

Map host devices into the container (HOST:CONTAINER).

Add the container user to additional groups.

IPC sharing namespace (e.g. shareable, service:name).

Container isolation technology (e.g. default, process, hyperv).

Container logging driver.

Options for the logging driver.

Disable OOM KillerDisable the OOM killer for this container.

Tune the host OOM preference (-1000 to 1000).

PID namespace to use (e.g. host).

Maximum number of PIDs in the container (-1 for unlimited).

Target platform (e.g. linux/arm64).

Read-Only Root FSMount the container root filesystem as read-only.

OCI runtime to use (e.g. runc, nvidia).

Security options (e.g. no-new-privileges:true).

Size of /dev/shm (e.g. 64m).

Stdin Open (Interactive)Keep stdin open even if not attached (equivalent to docker run -i).

Storage driver options.

Kernel parameters to set in the container.

Allocate TTYAllocate a pseudo-TTY (equivalent to docker run -t).

Run the container as a specific user:group.

User namespace mode (e.g. host).

UTS namespace mode.

Networks

Define custom networks for inter-service communication.

Driver for the default network.

Driver-specific options.

AttachableAllow standalone containers to attach to this network.
Enable IPv6Enable IPv6 networking.
Internal NetworkRestrict external access; isolate the network.

Metadata labels for the network.

External NetworkUse a pre-existing network created outside Compose.

Custom internal name for the network.

IP address management driver.

Driver-specific IPAM options as key-value pairs.

Volumes

Define named volumes for persistent storage.

Driver for the named volume.

Driver-specific options (e.g. NFS mount details).

External VolumeUse a pre-existing volume not managed by Compose.

Metadata labels for the volume.

Custom name for the volume.

Configs & Secrets

Manage configuration files and sensitive data for services.

Local file path for the config.

Create config content from the value of an environment variable.

Inline configuration content defined directly in the Compose file.

External ConfigUse an externally created config object.

Name of the config object in the container engine.

Local file path for the secret.

Extract the secret value from an environment variable.

External SecretUse an externally created secret object.

Name of the secret object in the container engine.