docker compose up accepts a --env-file to point to a .env file and set its contents as env vars, which are available when parsing the docker-compose.yaml. note that this is different from the env_file config option in docker-compose.yaml, which only sets env vars inside the container.
when providing dockerComposeFile in devcontainer.json there is currently no way to pass --env file.
suggestion (following microsoft/vscode-remote-release#4885 (comment)):
{
"dockerComposeFile": ["a.compose.yaml", "b.compose.yaml"],
"dockerComposeArgs": ["--env-file custom.env"]
}