Docker Community Forums

Share and learn in the Docker community.

Keeping DRY with multiple compose files, .env files, and directory structure best practices


(Jamiejackson) #1

I’ve got some questions that are much easier to ask with the help of a simple demonstration repo: https://github.com/jamiejackson/docker-compose-structure-questions

  1. I’m trying to grasp best practices for directory structuring for compose projects that have multiple environments included. This isn’t an easy thing to Google properly. If someone can point to an example of a project demonstrating, or a description of, (de facto, if necessary) best practices, please do so.
  2. I want to stay DRY as I feasibly can.
  3. I’m exploring .env files, but some of their behaviors are counter-intuitive to me.

I wouldn’t be surprised if I’m doing absolutely everything wrong, so any corrections/pointers would be appreciated.