Docker Compose
The compose file, .env, volumes, recreating services
The compose file, .env, volumes, recreating services
.env next to compose is for substituting ${…} into the compose file itself.The $ sign: $$ in compose, single quotes in .envIn a compose file, escape $ as $$.The secret file comes before up -dPut the secret file in place first, then change compose.The stack directory is the compose project name and the volume prefixBefore moving or renaming a stack directory, pin the project name or the volume names.Use ./ in volume paths, not $PWDWrite relative volume paths as ./db/.Whether up -d recreates a service shows in the config hashup -d recreates a container only if its final config changed.Entries from other topics that are about this too.