Is it a normal practice to include more than one Dockerfile in a project?

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?

  • Is there a way to lint the Dockerfile?
  • kubernetes volume for node_modules
  • how to split string to array and loop over it?
  • Connection Refused Error 61: Scrapy+splash Docker
  • Cadvisor support ELK stack
  • Is it possible to pin the container to a remote machine instead of a new container instance?
  • Docker: build using git push instead of ADD . /myapp
  • How to set host in nginx configuration running inside docker?
  • Separate Dev and Production instances and database
  • Docker busybox exit immediately
  • How do I install Docker on an NVIDIA Tegra Jetson TK1 with a 32 bit ARM processor running Ubuntu 14.04?
  • Can you use a Neo4j database created on a Windows machine as data volume of Neo4j on Docker?
  • 2 Solutions collect form web for “Is it a normal practice to include more than one Dockerfile in a project?”

    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.

    If you are only changing configuration parameters I would recommend you to reuse the Dockerfile and pass a configuration file as a parameter.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.