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

Gitlab Env's in a seperate file #600

Closed

Conversation

solidnerd
Copy link
Collaborator

Hey,
to make the environment configuration simpler. You could use an .env file. In my opionion it's a better way to set the environment configuration of the gitlab container. You could use it with the docker run --env-file=./.env aswell. Let me know what you think about it.

@sameersbn
Copy link
Owner

I don't think this is a good idea. It will break the quick start guide and will be painful to explain to users. Right now the quick start guide is plain and simple, download the compose file, edit and run.

@sameersbn
Copy link
Owner

Instead of the proposed solution I suggest loading an .env file from the data volume if it exists. ie. at https://github.com/sameersbn/docker-gitlab/blob/master/assets/runtime/env-defaults#L4 we add

if [[ -f ${GITLAB_DATA_DIR}/.env  ]]; then
  source ${GITLAB_DATA_DIR}/.env
fi

User would be able to create a .env file in the data volume with the desired configuration and would override anything that's specified using --env arguments.

I really don't want to get rid of the configuration options from docker-compose.yml since it's the expected location to specify env variables. the .env option could be a hidden or advanced configuration option for advances/experienced users 😄

What do ya think?

@Estebanv
Copy link

Estebanv commented May 4, 2016

I had some issues that could be fixed with the env file. Check this out: docker/compose#2120
My directory structure is:
/docker/gitlab/src
/docker/gitlab/data
/docker/redmine/src
/docker/redmine/data

For the yml and volumes. I'm also using your redmine containers, so this creates a conflict. With the env file, you can use a default COMPOSE_PROJECT_NAME to prevent that. I know you can also use the '-p' parameter, but then you have to use it with every command (up, stop, rm, etc).
Also i think this will lead to a much cleaner yml, which make its easier to read. I dont see how this breaks the guide, its the same in another file.

I really don't want to get rid of the configuration options from docker-compose.yml since it's the expected location to specify env variables.
Actually, the env file is where they are supposed to be IMHO.
Thanks for the hard work btw.

@solidnerd
Copy link
Collaborator Author

I will close this. This isn't needed anymore.

@solidnerd solidnerd closed this Mar 26, 2017
@solidnerd solidnerd deleted the feature-seperate-envoirment-file branch September 24, 2019 09:13
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

3 participants