jeudi 1 avril 2021

Use a single docker-compose.yml file with both Docker Compose and Stack, pro and cons?

I'm new of Docker, I'm exploring Docker Compose for development, and Docker Stack over Swarm for production.

I'm facing with issues comparing both capabilities, specifically with regard to use of Secrets, that are not supported without Swarm, and this implies a difference on how env variables are declared. This leads me to a question:

What are pro and cons of use a same docker-compose.yml file shared between Compose and Stack, and what are best patterns?

What I see in pro is that I can maintain a single file, that otherwise probably would share a lot of configuration with a "twin" docker-stack.yml.

What I see in cons is that instead the two files have specific different features, and aside of similarities, their scopes are fundamentally different. Even more if in future I will use a different orchestrating system, where probably a stack file will be totally replaced.

Is recommended to keep these file separated, or is acceptable to unify into a single with specific techniques?

Aucun commentaire:

Enregistrer un commentaire