{"id":13416551,"url":"https://github.com/francescou/docker-continuous-deployment","last_synced_at":"2025-09-16T12:10:46.615Z","repository":{"id":149018576,"uuid":"44903921","full_name":"francescou/docker-continuous-deployment","owner":"francescou","description":"continuous deployment of a microservices application with Docker","archived":false,"fork":false,"pushed_at":"2017-08-01T17:25:15.000Z","size":379,"stargazers_count":141,"open_issues_count":0,"forks_count":40,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-31T21:57:10.868Z","etag":null,"topics":["continuous-deployment","docker","docker-compose","docker-swarm","docker-swarm-mode","microservices","nginx","swarm-mode"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/francescou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-25T09:37:45.000Z","updated_at":"2023-08-24T07:33:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"8393e99e-9a4d-40da-9ad1-a00a620a1df4","html_url":"https://github.com/francescou/docker-continuous-deployment","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescou%2Fdocker-continuous-deployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescou%2Fdocker-continuous-deployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescou%2Fdocker-continuous-deployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescou%2Fdocker-continuous-deployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francescou","download_url":"https://codeload.github.com/francescou/docker-continuous-deployment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228204547,"owners_count":17884711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-deployment","docker","docker-compose","docker-swarm","docker-swarm-mode","microservices","nginx","swarm-mode"],"created_at":"2024-07-30T21:01:00.659Z","updated_at":"2025-09-16T12:10:41.507Z","avatar_url":"https://github.com/francescou.png","language":"HTML","readme":"# Continuous Deployment with Docker (swarm mode)\n\n\n## Description\n\nThis project shows a web application built using a microservices architecture.\n\nThere are two microservices:\n- **rest-count** implemented in Python (Flask microframework) using a Redis database\n- **rest-ip** implemented in Node.js (Express framework) using a MongoDB database\n\ndeployed as docker services on a swarm cluster\n\nYou can find additional information on my [Slideshare presentation \"Always be shipping\"](http://www.slideshare.net/francescou/always-be-shipping)\n\n![Diagram](docs/diagram.png)\n\n## Prerequisites\n\nDocker 17.06.0-ce\n\n(see [legacy](https://github.com/francescou/docker-continuous-deployment/tree/legacy) tag if you're interested into the previous version for Docker 1.11 using docker-compose and consul.)\n\n## Getting started\n\nrun on a single node docker swarm cluster the following commands in terminal (the first time you have to wait for a few minutes to download the Docker base images), :\n\n```\ndocker stack deploy -c docker-compose.yml cd\n```\n\nopen your browser to \u003chttp://127.0.0.1:8080/\u003e\n\nyou can check the services on \u003chttp://127.0.0.1:8080/visualizer/\u003e\n\nnow edit `rest-count/main.py` (for example, you can increase the version to 1.1)\n\n```\ndocker build -t francescou/rest-count:1.1 rest-count/\n\ndocker service update --image francescou/rest-count:1.1 cd_restcount\n```\n\nthe updated microservice will be deployed with no downtime.\n\nYou can also modify the _rest-ip_ microservice in the same way (see `rest-ip/app.js`).\n\n## Scaling microservices\n\nthis section will explain how to can scale up and down the docker services.\n\nopen your browser to \u003chttp://127.0.0.1:8080/visualizer/\u003e. There you will find a _rest-count_ service, running on two replicas. Execute\n\n    docker service scale cd_restcount=4\n\ncheck again \u003chttp://127.0.0.1:8080/visualizer/\u003e to ensure that there are now four _rest-count_ instance.\n\nMake a few requests to \u003chttp://127.0.0.1:8080/api/v1/count\u003e and then run `docker service logs cd_restcount` to see how requests are processed by different _rest-count_ instances.\n\nYou can now scale down the _rest-count_ service without having any down time, e.g.:\n\n    docker service scale cd_restcount=2\n\nAgain, you can check \u003chttp://127.0.0.1:8080/visualizer/\u003e to see that there are now only two instances.\n","funding_links":[],"categories":["Development with Docker","HTML","HarmonyOS","docker","Continuous Integration / Continuous Delivery"],"sub_categories":["CI/CD","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancescou%2Fdocker-continuous-deployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancescou%2Fdocker-continuous-deployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancescou%2Fdocker-continuous-deployment/lists"}