Deploy files to a swarm cluster?


I’m new to docker and docker swarm and i’m about to migrate my Rasbian Pie webserver cluster to docker swarm. Fun stuff!

However, one thing i still havent managed to sort out is how it works with deployment of PHP-code/files.

As of today i’m deploying code from my laptop to my github rep, which is then deployed with deployobot on to my webserver. The rsync function is then updating the files on my other pies.

How do i make this work with docker swarm? Do i haft to build a container on my laptop and deploy the container? Or can i just update the code on my master and the workers will automatically update themselfe?


1 approach could be you build the container in your laptop, push it to central container registry and docker swarm master pulls the container from the registry and deploys on workers.
Another approach could be building the code locally, push to git, have a git hook to container builder like docker cloud, push it to container registry and docker swarm pulls it from container registry.