Intermediate
Docker & Containers
Q72 / 100
What does the ".env" file do in a docker-compose project by default?
Correct! Well done.
Incorrect.
The correct answer is B) Compose automatically reads variables from a ".env" file in the project directory and substitutes them into the docker-compose.yml file (e.g. "${DB_PASSWORD}")
B
Correct Answer
Compose automatically reads variables from a ".env" file in the project directory and substitutes them into the docker-compose.yml file (e.g. "${DB_PASSWORD}")
Explanation
Compose automatically loads a ".env" file from the project root and substitutes its variables into the compose file using "${VAR}" syntax, useful for keeping configuration/secrets out of version control.
Progress
72/100