Reputation: 7405
If I have a web project in source control and I want to include all the necessary configuration to run it, should I be using more than one Dockerfile to define different profiles for my database, web and data containers?
Are there any examples of this practice?
Upvotes: 1
Views: 1272
Reputation: 18689
No, You should either allow the profiles to be mounted in using volumes so that you can use the same container with different configurations or setup all the configurations and then allow the profile to be selected based on environment variable or commands to docker run.
The first approach is preferable as no information about your configuration bleeds into the container definition. You may even make your container public as it may be of use to other people.
Upvotes: 2
Reputation: 9904
If you are only changing configuration parameters I would recommend you to reuse the Dockerfile and pass a configuration file as a parameter.
Upvotes: 0