I was puzzled by this and came to the conclusion Configuration Management [CM] is best left to the actual CM tools, and Docker just isn't one.
That was in the days docker-compose wasn't even a choice for me, because docs explicitly said that it's not for the production - but even now I don't see a sane way to automatically (re)configure 2-3 hosts[1] in with a single CLI command (and keep the secrets defined in one single "master" place that's outside of version control) with the Docker-provided toolset. Which is dead easy with Salt or Ansible (+bare Docker, of course, since it's Docker containers that are deployed)
(Haven't looked into recently-introduced Docker Swarm, though, maybe they have something there.)
I use environment variables for smaller projects, i have predefined environment variables for the images that get substituted for the real thing by docker compose, which in turn uses environment variables (here is an example: https://github.com/intellimate/Server/blob/master/image/comp...).
For larger projects i would use docker-swarm or kubernets, they have their own solution.
It still sometimes happens that i am amazed how easy it is. A few weeks ago i switched servers for a small project and docker-compose up was all i needed to do.