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

Consider stopping use of environment variables to communicate with containers #250

Closed
rfay opened this issue May 22, 2017 · 11 comments
Closed

Comments

@rfay
Copy link
Member

rfay commented May 22, 2017

What happened (or feature request):

We use both straight structured yaml in our docker-compose.yml and also free-form environment variables (in the environment: section of each container). It's (probably) hard to understand for the end user that may want to edit. For example, we have VIRTUAL_PORT and TCP_PORT as environment variables and the a yaml "-ports" section.

What you expected to happen:

  • All config information delivered to containers to be handled explicitly in the yaml (or perhaps via labels)
  • environment: specification should still be there for custom configuration of custom containers.

How to reproduce it (as minimally and precisely as possible):

Anything else do we need to know:

Related source links or issues:

@beeradb
Copy link
Contributor

beeradb commented May 22, 2017

Can you expand on specifically what is meant by "Environment specification still there for custom configuration of custom containers."?

As I read that you are just advocating for reducing the number of env vars we use, and not completely removing them?

@rfay
Copy link
Member Author

rfay commented May 22, 2017

I'm suggesting that end users could use environment variables to deliver info/config to their custom containers, providing them a simple hack for configuration, but we would not populate any config via env in our standard config.

@beeradb
Copy link
Contributor

beeradb commented May 22, 2017

So, the heart of this seems to be whether or not to support user customization of our standard (i.e. web/DB) config?

@rfay
Copy link
Member Author

rfay commented May 22, 2017

No, I don't agree with that @beeradb - I was thinking we would support user customization of everything. But the standard things that we know about in advance (for our containers) would be done with yaml. Environment variables would just be an escape hatch for user customization of special containers.

@beeradb
Copy link
Contributor

beeradb commented May 22, 2017

I see. No opposition to that proposal in theory. I think what would help color this conversation is if we could identify the specific environment variables that we feel are useful as an "Escape hatch" vs the ones which we feel should be removed. From there, our next steps could be:

  1. Template the env vars we feel we can remove
  2. Document the ones we keep, so users have some understanding of expectations

I agree we most likely have more than we need, but I haven't looked at it with a critical eye recently. And even if we find we do need 100% of what's there, documenting them would still be a very positive step.

@beeradb beeradb changed the title Consider not using environment variables in ddev docker-compose.yaml Audit ddev environment variables: document the ones we need to keep, and template those we don't May 22, 2017
@beeradb
Copy link
Contributor

beeradb commented May 22, 2017

I took the liberty of updating the title, I hope the proposed next steps work for you. Feel free to change back if they don't.

@beeradb beeradb changed the title Audit ddev environment variables: document the ones we need to keep, and template those we don't Audit docker-compose environment variables: document the ones we need to keep, and template those we don't May 22, 2017
@rfay
Copy link
Member Author

rfay commented May 22, 2017

I was saying that users could create any environment variable they wanted and use them in the environment section, and that we would use none for our purposes. So we would then not use:

      - PMA_USER=root
      - PMA_PASSWORD=root
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - VIRTUAL_PORT=8036
      - DEPLOY_NAME=local
      - TCP_PORT=$DDEV_HOSTNAME:3306

@rfay
Copy link
Member Author

rfay commented May 22, 2017

New title isn't accurate given what I think I'm after ;) Because I'm saying get rid of all of them (but support that mechanism for users)

@rfay rfay changed the title Audit docker-compose environment variables: document the ones we need to keep, and template those we don't Consider stopping use of environment variables to communicate with containers May 22, 2017
@rfay
Copy link
Member Author

rfay commented May 22, 2017

I edited the OP and title just a bit, hoping to narrow this more. It's only about the environment: section and not about preprocessing of the docker-compose.yml. Sorry for all the misdirection today.

@rickmanelius
Copy link
Contributor

Updating labels because I'm not fully sure I understand the implications and the priority.

@rfay
Copy link
Member Author

rfay commented Sep 25, 2018

This isn't happening right now, and is even more entrenched, so closing at this point.

@rfay rfay closed this as completed Sep 25, 2018
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

No branches or pull requests

3 participants