1

What's the right way to share environment and code between team members? I need this for local development. In my vision, a developer download from a git repo the environment (basically a docker compose with subfolders and configuration), then pull from another repo the code and put it inside the right folder of the previous structure.

REPO1 -> docker-compose with configuration, specific Dockerfile etc.
REPO2 -> code

So I'll have two separate, and then nested, git repositories, at this point I can build and deploy the whole thing. Is it the right path?

  • Should I build a docker image and share that, instead of the environment details? Can I then pull code and insert it?
  • How do you commit empty folder (the one that will be used to host the code) in a git repository without using the ".keep file" trick?

As you can see I'm a newbie and have quite a bit of confusion in my head. Any help would be appreciated. Thanks.

Jumpa
  • 4,319
  • 11
  • 52
  • 100
  • What are you hoping to get from using Docker here? Why is the repository of code insufficient? It's common to keep Docker-related artifacts in the application repository itself (a `Dockerfile` that builds a self-contained image of the application that doesn't require bind mounts; a `docker-compose.yml` that can run the application and its dependencies) which potentially simplifies things. – David Maze Jan 23 '21 at 12:53
  • Yeah but that way i'll have different repositories between local/dev/prod. Even if similar they surely have something different, so I can't mix code and infrastructure. – Jumpa Jan 23 '21 at 13:33
  • Do you want to share containers and its configurations to all members of your team? – JRichardsz Jan 23 '21 at 13:34
  • @JRichardsz exactly. – Jumpa Jan 23 '21 at 13:55
  • Will this help you : https://stackoverflow.com/a/60780840/3957754 ? – JRichardsz Jan 23 '21 at 16:08

0 Answers0