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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite docker-compose.yml for following writing standards and Use env_file instead of environment #6

Closed
wants to merge 2 commits into from

Conversation

tenshiAMD
Copy link

This will lessen the redundancy of the environment declarations and helps for easily changing the environment without changing the environments of the other containers at the same time; allowing it to be more flexible to use since environments are shared with the different containers. 馃憤

@tenshiAMD tenshiAMD changed the title Use env_file instead of environment flag to share environments Rewrite docker-compose.yml for following writing standards and Use env_file instead of environment Oct 19, 2016
@neckhair
Copy link
Owner

Thanks @tenshiAMD for your PR. I already started working on this ;-). I'll have a look later.

Copy link
Owner

@neckhair neckhair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also have to change to following line in database.yml:

password: <%= ENV['DB_ENV_MYSQL_ROOT_PASSWORD'] %>

This should now point to the changed env variable.

@@ -0,0 +1,4 @@
MYSQL_ROOT_PASSWORD=mypass
SECRET_KEY_BASE=abcdefg
VIRTUAL_HOST=beer.docker
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not go in here. Because every time a container with this env variable is launched nginx picks that up. you can define it in the specific section of the docker-compose.yml.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way is to separate the env file that needed to separated environments to the other container, I'd just noticed the declared environment variables are redundant to others so I'd use the env file to remove the redundancy and make it more flexible if adding another environment variable.

Copy link
Owner

@neckhair neckhair Oct 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the VIRTUAL_HOST env variable is only used in the web containers. So this specific one is actually no duplicated. The others are fine in here becuase they are used in several containers.

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.

None yet

2 participants