Docker Compose Tip #56: env_file advanced patterns
The env_file key looks simple but has surprisingly rich behavior, you can load multiple files, mark some as optional, and control how they’re parsed. The two flavors of .env There are two completely different things called “.env” in Compose: The project .env file at the same level as compose.yml, used for interpolation of ${VAR} in the Compose file itself (see Tip #42) env_file: at service level, loaded as runtime environment variables inside the container This post is about the second one. ...