Docker and CI/CD · Middle · Question 18 of 75
In Compose, what is the difference between the .env file and env_file:?
- 1They're identical, and Compose simply merges both of them
- 2
.envis for production values, whileenv_fileis for development - ✓Correct answer:
.envfills${VAR}in the YAML;env_filesets container variables
Explanation
The project .env is used for interpolation in compose.yaml. Variables reach the container only through environment: or env_file:.