Summary

  • stop auto-injecting .env into env_file for parsed compose services/applications
  • preserve only explicitly defined env_file entries from user compose
  • refactor env_file normalization into a shared helper for both parser flows
  • add regression coverage for env_file normalization + structure guards

Why

Docker Compose semantics treat .env as interpolation input, not implicit runtime env injection for every service. Auto-injecting .env can leak variables into containers that never opted in.

Scope

This PR is intentionally minimal and only contains #7655-related parser/test changes.

Tests

  • php -l bootstrap/helpers/parsers.php
  • php -l tests/Unit/ComposeEnvFileSemanticsTest.php
  • tests/Unit/ComposeEnvFileSemanticsTest.php covers:
    • normalization + trim + dedupe behavior
    • missing env_file behavior
    • invalid non-string filtering
    • helper usage in both parser flows + no implicit ->push('.env')

Docs

N/A - internal parser behavior change; no user-facing service template/docs page changes.

Bounty

/claim #7655

Claim

Total prize pool $75
Total paid $0
Status Pending
Submitted February 20, 2026
Last updated February 20, 2026

Contributors

13

1312e

@1312e

100%

Sponsors

TO

Tom Adamczewski

@tadamcz

$75