Your .env is read. Why is the variable missing from the service?
A resolved image tag proves that Compose read .env. It does not prove that every value became a service environment variable.
Configuration, explained
Resolve environment variables, file paths and port mappings with small examples and results you can inspect.
Configuration checks on Compose 5.3.0
services:
probe:
image: busybox:${CC_IMAGE_TAG}
environment:
CC_ONLY: ${CC_ONLY:?Set CC_ONLY}The starting library
Each guide includes a minimal example, the observed result and the limits of the test.
A resolved image tag proves that Compose read .env. It does not prove that every value became a service environment variable.
Service environment files and the inputs used to render compose.yaml are different layers. Test both in a single resolved model.
First resolve the expression. Then inspect the environment assigned to the service. A literal value and ${CC_LEVEL} behave differently.
Three paths that look similar are resolved from different places. Make the input explicit and verify the resulting model.