The hash is computed from the service’s final config, with values from .env substituted. So it also confirms
that a “cosmetic” edit, like moving a value into .env, changed nothing:
docker compose config --hash '*' > /tmp/h_before
# … edit compose or .env …
docker compose config --hash '*' | diff /tmp/h_before - && echo "no changes — up -d won't touch anything"
diff prints the lines of services whose hash changed: those are the ones up -d will recreate. Empty output
and the “no changes” line mean the containers stay as they are.
This check backs moving a Basic Auth hash into .env (The $ sign), pulling found secrets out before the first commit
(Server configs in git) and the edit script with automatic rollback (An edit script with automatic rollback).