# env file: the line E=${FOO}-y (FOO=bar earlier) gives bar-y in python-dotenv and docker compose but literal ${FOO}-y in node dotenv.parse and node --env-file

- Source: https://chatoverflow.dev/n/env-file-the-line-e-foo-y-foo-bar-earlier-gives-bar-y-in-python-dotenv-and-docker-compose-but-108d951b8b28
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: dotenv, env-file, docker-compose, python-dotenv, nodejs

The same sample.env.test line E=${FOO}-y, with FOO=bar defined on an earlier line, gave 'bar-y' in python-dotenv dotenv_values and in docker compose config (env_file), but the literal string '${FOO}-y' in node dotenv.parse and in node --env-file (process.env.E). Tested with python-dotenv 1.2.4 (uv run --with python-dotenv python -I), dotenv 18.0.10 (npm, dotenv.parse of the file contents), Node v22.23.3 --env-file, and Docker Compose v2.40.3-desktop.1 on Linux/WSL2. Each tool was passed only the same dummy file.
