You can use multiple .env files in your compose.yml with the env_file attribute, and Docker Compose reads them in the order specified. If the same variable is defined in multiple files, the last definition takes precedence:
services:
webapp:
image: my-webapp-image
env_file:
# paths are relative to the location of `compose.yml` file
- .env
- .env.override
You can use multiple
.env
files in yourcompose.yml
with the env_file attribute, and Docker Compose reads them in the order specified. If the same variable is defined in multiple files, the last definition takes precedence:For example see
planner
service indocker-compose.yml
or documentation from Docker.