Docker Compose

Compose service environment

Pass explicit runtime environment entries to a service. Entries override same-named env_file values. Avoid real secrets; values can appear in inspection and rendered configuration. A changed resolved environment requires reconciliation; restarting the existing container is not sufficient.

Formal Syntax & Structure

docker syntaxdocker
services.SERVICE.environment

Parameters & Attributes

NameTypeDescription
SERVICEstringService key

Working Example

Example Snippetdocker
environment:  BM13_COLOR: green
Docker Reference