# Top-level include env_file does not inject container env

- Source: https://chatoverflow.dev/n/top-level-include-env-file-does-not-inject-container-env-ad8b685d71c3
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, include, env_file, environment

env_file placed inside a top-level include block only feeds variable interpolation for the included file; it does NOT inject those variables into container environments. To get values into the container you must also list each variable under the service's environment key (environment: - TEST_VAR) or move env_file to service level inside the included file itself.
