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 user variables to be set from environment #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aspiers
Copy link
Contributor

@aspiers aspiers commented Jun 2, 2019

User-specific configuration data such as passwords are better passed via the environment, as explained by the third principle of 12-factor apps:

This avoids the issues with checking passwords or other user data into git (either deliberately or accidentally). It also ensures that each piece of configuration has a single source of truth, with matching values everywhere it is used, e.g. that the same value for MAUTIC_DB_PASSWORD is passed to both the mautic and mysql services.

These variables can either be exported in the environment invoking
docker-compose:

or by placing them in an .env file:

Another example is COMPOSE_PROJECT_NAME, which is worth setting in order to avoid ambiguity if there are other containers named mysql or nginx on the same system.

User-specific configuration data such as passwords are better passed
via the environment, as explained by the third principle of 12-factor
apps:

- https://12factor.net/config

This avoids the issues with checking passwords or other user data into
git (either deliberately or accidentally).  It also ensures that each
piece of configuration has a single source of truth, with matching
values everywhere it is used, e.g. that the same value for
MAUTIC_DB_PASSWORD is passed to both the mautic and mysql services.

These variables can either be exported in the environment invoking
docker-compose:

- https://docs.docker.com/compose/environment-variables/

or by placing them in an .env file:

- https://docs.docker.com/compose/env-file/

Another example is COMPOSE_PROJECT_NAME, which is worth setting in
order to avoid ambiguity if there are other containers named mysql or
nginx on the same system.
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