Skip to content

Conversation

@iamluc
Copy link

@iamluc iamluc commented Sep 7, 2015

Having one docker-compose.yml file in a project can sometime lead to conflicts with others developers as we all need to adapt it to our needs (ports, volumes, environments, etc..).

With this PR, I suggest to allow compose to look at docker-compose.yml.dist if docker-compose.yml does not exist.
So the .dist file can be added to the VCS of the project, but can still be overrided by creating the file docker-compose.yml (excluded in the VCS).

This strategy is used for example by phpunit

Signed-off-by: iamluc <luc@vieillescazes.net>
Signed-off-by: iamluc <luc@vieillescazes.net>
@thaJeztah
Copy link
Member

First impression: nice, I like it 👍

@dnephin
Copy link

dnephin commented Sep 8, 2015

Since this is a new convention, I think it's going to require some discussion.

My initial impression is that it might be good to support some kind of fallback (in addition to the "legacy filename" fallbacks we already do). I'm not sure what the filenames should be, or if we should actually make it configurable.

#745 proposed supporting a .compose directory which would allow us to include configuration for this kind of thing (meta-configuration).

If we don't allow it to be configurable, I'd prefer to keep the .yaml extension, but I'm not sure how that would look.

It's also worth mentioning that this can be accomplished pretty easily within a team or organization with a bash script wrapper and -f or COMPOSE_FILE

@iamluc
Copy link
Author

iamluc commented Sep 9, 2015

It's also work mentioning that this can be accomplished pretty easily within a team or organization with a bash script wrapper and -f or COMPOSE_FILE

Sure, but wrappers are often a pain because they are differents on each projects: path/name, options, etc...
IMHO, a standard is better

@thaJeztah
Copy link
Member

Yes, adding a wrapper is easy to do, but having it "officially" in compose will add to a standardized way to distribute a compose app (in stead of each project using their own way).

I think if a docker-compose.yml.dist is found, but no docker-compose.yml, Compose should output a warning, e.g. **WARNING** using 'docker-compose.yml.dist' you should create your own project-file ..

@aanand
Copy link

aanand commented Sep 11, 2015

See #1987 (comment) for an alternative solution which also serves the multi-environment use case.

@mnowster
Copy link

Closing this as we now have the alternative solution done here #2051

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.

6 participants