I have a number of servers running as a swarm using docker swarm mode. There are several (5+) stacks running in the swarm each with their respective docker-compose.yml files.
I am mainly using docker stack deploy to manage my stacks (editing my docker-compose.yml then running deploy so that the compose files remain a true reflection of the running configuration). The down-side of this is that any changes I make directly to a service are lost on the next deploy, and it prevents me from using tools like portainer to their full potential.
In an ideal world I would like to be able to export my entire running configuration to a collection of docker-compose.yml files allowing me to manage any divergence between the running config and my current config.
I can see that I could roll something of my own using some shell scripting, docker inspect -f and some go templates, but I would have to maintain this all myself.
Are there tools or libraries out there to support my use case?