O
O
old kitty2020-07-08 11:32:09
Docker
old kitty, 2020-07-08 11:32:09

Is it necessary to move the docker environment to a separate repository?

Good afternoon!

The question arose:
Does it make sense to move the docker/vagrant/%tool_name% environment to a separate repository, or is it worth keeping everything together with the code, so that it would start "with one button" in one folder?

There are doubts that it makes sense to store everything in one turnip when the environment is not used on the docker/vagrant/%tool_name% production.

In my opinion, the separation is supported by the fact that in theory it is possible to store dev and prod environment configurations in different branches, without clogging the branches of the code turnip.

It would be interesting to know what is the correct way.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Pankov, 2020-07-08
@oldkitty

That's right - store the code in one repository.
On prod, you don't even need to have git or whatever you have as a version control system.
You need to configure CI / CD so that only the necessary files and directories are rolled into the container for production, nothing more.
It is very convenient when the code works without a docker in a development environment, but it is convenient to keep related things like a database and other services in containers and on a development machine. This makes it easier to deploy a development environment and get employees into the process faster. Technically, there are no special problems to set up remote debugging right inside the container. this way you can bring the development environment closer to the product configuration.
In general, a lot depends on the complexity of your project, on the number and connectivity of your modules, on the mechanisms aimed at scalability.
Keep everything you need for CI/CD in the same repository as the code. There you also have tests (not needed in the product), auxiliary scripts, tooling artifacts, and so on.
Look, there are many so-called "Cookie Cutters" in the github. This is a tool for templating projects on different stacks. As a rule, a project blank created according to such a template already has everything necessary for CI / CD.

D
Dmitry, 2020-07-08
@dmtrrr

The Dockerfile is very dependent on paths, it is inconvenient to store it in another repository.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question