Skip to content

Conversation

@Tristan-WorkGH
Copy link
Contributor

In #334 we were using COMPOSE_FILE env-var, same as -f/--file cli arg to use multiple compose files in our profile folders (explicit, study, suite, ...).
Problem: the bind mounts path to local paths is sensitive from where we do the docker compose ... commands (look with docker compose config).
Solution: the include feature (howtos) since Docker Compose v2.20.0 permit to modularise file with the paths always resolved from the yaml where it declared, not from the current directory (pwd).
Verifying:

# from deployment/docker-compose/explicit-profiles
git checkout main
docker compose --profile all config > explicite.before.yaml
git checkout rework-compose-files
docker compose --profile all config > explicite.after.yaml
diff --color <(yq -P 'sort_keys(..)' -o=props explicite.before.yaml) <(yq -P 'sort_keys(..)' -o=props explicite.after.yaml)
#rm explicite.*.yaml

The config files has also been reorganized per service for easier management.

I also use this version since two months now without problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants