Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom compose configuration and env files to be loaded per-project #1558

Open
lpeabody opened this issue Aug 30, 2021 · 2 comments
Open

Comments

@lpeabody
Copy link
Sponsor Contributor

Feature request

Conversation driving request originates from #1557 (comment).

Summary

Be able to load in additional docker-compose configuration and env files in addition to docksal.yml, docksal.env, docksal-environment.yml and docksal-environment.env. These additional files would be chained in between Docksal's core configuration and environment files, the project's docksal.yml and docksal.env files, but before the environment specific files.

@lpeabody
Copy link
Sponsor Contributor Author

Use case copied from PR linked in summary:

@lpeabody Something like #2 sounds like it'd work great. I also had seen the documentation for docker-compose to allow for multiple configuration files, so I think that sounds great!

In my specific use case, our organization has a great many Drupal properties. which use Docksal for local development. These Drupal properties are mostly different enough to need their own unique configurations (their own custom docksal-local.yml), but there are common, shared tools that all properties utilize. A single team manages those shared tools. Currently, when a shared tool is implemented/updated, the Necessary Docksal updates to configuration have to be manually completed for each property, even though we also have the same team's non-docksal infrastructure updates ingested automatically to each property and built via composer. If we could have a separate docksal-configuration.yml file, each project would get the updates on a regular composer update, removing the manual updates.

I'll go one step further to demonstrate the need, even though that paragraph may have been enough—I have explored patching the docksal-local.yml files on composer install as a post script, but being that it's a .yml file, I can't rely on updates being appended under the correct properties. I say this just to demonstrate that altering an existing file doesn't seem feasible, causing us to look for a way to include a separate file.

@ryanissamson
Copy link

Thanks for opening this, @lpeabody. So far, we'd discussed that docker-compose compose supports multiple configuration files by stringing together files, e.g.
docker-compose -f ~/.docksal/stacks/services.yml -f ~/.docksal/stacks/stack-acquia.yml -f ./project/.docksal/docksal.yml -f ./project/.docksal/docksal-local.yml

Ideally, Docksal would support one or more configuration files beyond the -local env and yml files. Furthermore, if it could do so without having to specify them in a command, that'd allow project maintainers to just inherit custom configuration updates without needing to modify scripts or commands. For example, if docksal-local.yml is automatically picked up, then being able to name a configuration file in a predictable way, docksal-local-overrides.yml or being able to define override files to in docksal.env. You had indicated that the -local.yml file should take priority, which I'm fine with as well.

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

No branches or pull requests

2 participants