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.environmentParameters & Attributes
| Name | Type | Description |
|---|---|---|
| SERVICE | string | Service key |
Working Example
Example Snippetdocker
environment: BM13_COLOR: green