0

I have a Docker Swarm running (spread over three nodes), and pulling images from my private dockerhub repo.

So I can have multiple web applications spread over the same swarm, I'm using Traefik as a proxy.

For each web application, I have a docker-compose.yml and launch it to the stack:

docker stack deploy -c example.yml example docker stack deploy -c exampletwo.yml exampletwo 

The actual *.yml files are all stored in a home folder of one specific swarm manager node.

I don't feel like this is best practice, as I'm going to end up with:

/home/user/example.yml /home/user/exampletwo.yml /home/user/examplethree.yml etc 

which seems messy in that they are all together and open to mistakes and loss. And all documenation I read always refers to just using docker-compose.yml; but that doesn't work when I have multiple (totally separate) web applications (I don't want to put all services into one main yml as they are all fundamentally totally unrelated)

Is there a best practise way of doing this? I wonder if I'm missing something fundamental with how to get the yml file available on the node to docker stack deploy

Share
3
  • 2
    Doesn't seem messy to me. Keep them under version control and have some sort of deployment process and you are all set.Jun 15 at 1:25
  • 1
    As @RobertMoskal sudgested, best practice is to store all of the deployment configuration inside version control and set up a CD flow. You cant miss with that :)
    – matic1123
    Jun 15 at 6:23
  • git. definitely git. ^Jun 15 at 14:54

0

Browse other questions tagged or ask your own question.