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

.env override for docker-compose.yml #481

Closed
wants to merge 9 commits into from
Closed

.env override for docker-compose.yml #481

wants to merge 9 commits into from

Conversation

wookiefriseur
Copy link
Contributor

What do you think of this?

  1. easy override without touching any YAMLs
  2. local update to latest versions without merging (for people with custom settings)
  3. no duplicates with settings that have arrays
    • when I use docker-override.yml, it for instance binds ports from both ymls

Example:

  • "${HOST_PORT:-7860}:7860" - setting in docker-compose.yml
  • HOST_PORT=12345 - override in .env

@wookiefriseur
Copy link
Contributor Author

Oh, the draft wasn't supposed to start your Actions, sorry. Hope it's free

@AbdBarho
Copy link
Owner

AbdBarho commented May 23, 2023

Thank you.

Most of the stuff could actually be configured with docker-compose.override.yml, which is the recommended way, without the need of an .env file.

There is a discussion for the overriding the ports, because this is not possible per default. #430

I would prefer to keep the changes limited to the port, with one value for all UIs. Maybe we need to have a consistent prefix for the variable, something like WEBUI_ or similar.

Oh, the draft wasn't supposed to start your Actions, sorry. Hope it's free

Oh yeah it is all free!

@wookiefriseur
Copy link
Contributor Author

Thanks, didn't see the discussion. Will continue there. You can close or use this PR if you want.

@LEv145
Copy link
Contributor

LEv145 commented Jun 25, 2023

Thank you!

I think it's better to add WEBUI_PORT and WEBUI_ARGS for each service, because WEBUI_ARGS for all services is different, as is the port if you use more than one service at the same time
I use several services with different ports, I have not experienced any problems

@AbdBarho
Copy link
Owner

I have added a minimal solution #521, which should be enough, I don't believe we need a high level of very granular customizability through the env file, a docker compose override should help you get most of the way there.

@wookiefriseur
Copy link
Contributor Author

I think it's better to add WEBUI_PORT and WEBUI_ARGS for each service, because WEBUI_ARGS for all services is different, as is the port if you use more than one service at the same time

I had it like that at first, but when services change you would have to keep track of the names. Right now you can have multiple .env files and load them on demand like so:

  1. docker compose --env-file .env-auto --profile auto up
  2. docker compose --env-file .env-comfy --profile comfy up
  3. and so on ...

I use that for switching between profiles with my custom settings. I don't have the resources to run multiple profiles at the same time so I did not test that use case.

I have added a minimal solution #521, which should be enough, I don't believe we need a high level of very granular customizability through the env file, a docker compose override should help you get most of the way there.

That's an OK solution for now, removing the multiple port problem. Good enough for my use cases. 👍
People with multiple profiles can use a mix of custom .env files for the port and docker-compose.override.yml for the rest.

Let's just hope docker compose gets a patch to make the override more useful. The latest release does not seem to do what we need: #430 (reply in thread)

@wookiefriseur wookiefriseur changed the title make docker-compose settings overrideable by env .env override for docker-compose.yml Aug 1, 2023
@AbdBarho
Copy link
Owner

I will close this PR now, thank you for contributing, if we want to add this in the future I will reach out to you again.

@AbdBarho AbdBarho closed this Aug 26, 2023
@wookiefriseur wookiefriseur deleted the feature/env-override-support branch August 27, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants