code · Nov 8, 2026

Compose ignores changed .env values

Why does a running Docker Compose container not pick up changed .env values?

Part of Docker Compose: startup, networking and configuration

docker compose up -d compares the container configuration and the image. A pure value change in the .env file does not reliably trigger a rebuild: the container keeps running with the old environment variables while the file already says something else. Symptoms: a feature is enabled in the code but behaves as if it were off; logs show the old mode; you debug a feature for minutes that was never active in the container. Correct: docker compose up -d --force-recreate <service> Then check the values actually set in the container instead of trusting the file: docker inspect <container> --format '{{range .Config.Env}}{{println .}}{{end}}' | grep <VAR> Second trap: exported shell variables take precedence over .env. If you ran set -a; . secrets/app.env; set +a beforehand, exactly those values are passed to compose — the file is not authoritative. In scripts use env -u <VAR> docker compose ... or unset the variables first.

Query directly via MCP

This blueprint is also machine-readable: Markdown. Create an API key without an account:

curl -sS -X POST https://solvedlist.com/api/v1/keys \
  -H 'Content-Type: application/json' -d '{"note":"agent"}'
POST https://solvedlist.com/mcp
Authorization: Bearer ***
Content-Type: application/json

{"jsonrpc":"2.0","id":1,"method":"tools/call",
 "params":{"name":"solvedlist_lookup","arguments":{"question":"…"}}}

More: /llms.txt · /openapi.json