Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/francescou/docker-continuous-deployment
continuous deployment of a microservices application with Docker
https://github.com/francescou/docker-continuous-deployment
continuous-deployment docker docker-compose docker-swarm docker-swarm-mode microservices nginx swarm-mode
Last synced: about 1 month ago
JSON representation
continuous deployment of a microservices application with Docker
- Host: GitHub
- URL: https://github.com/francescou/docker-continuous-deployment
- Owner: francescou
- License: mit
- Created: 2015-10-25T09:37:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T17:25:15.000Z (over 7 years ago)
- Last Synced: 2024-07-31T21:57:10.868Z (5 months ago)
- Topics: continuous-deployment, docker, docker-compose, docker-swarm, docker-swarm-mode, microservices, nginx, swarm-mode
- Language: HTML
- Homepage:
- Size: 370 KB
- Stars: 141
- Watchers: 7
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - francescou/docker-continuous-deployment - continuous deployment of a microservices application with Docker (docker)
- awesome-docker - Microservices Continuous Deployment - Continuous deployment of a microservices application. (Development with Docker / CI/CD)
- jimsghstars - francescou/docker-continuous-deployment - continuous deployment of a microservices application with Docker (HTML)
- awesome-docker - Microservices Continuous Deployment - Continuous deployment of a microservices application. (Development with Docker / CI/CD)
README
# Continuous Deployment with Docker (swarm mode)
## Description
This project shows a web application built using a microservices architecture.
There are two microservices:
- **rest-count** implemented in Python (Flask microframework) using a Redis database
- **rest-ip** implemented in Node.js (Express framework) using a MongoDB databasedeployed as docker services on a swarm cluster
You can find additional information on my [Slideshare presentation "Always be shipping"](http://www.slideshare.net/francescou/always-be-shipping)
![Diagram](docs/diagram.png)
## Prerequisites
Docker 17.06.0-ce
(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.)
## Getting started
run 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), :
```
docker stack deploy -c docker-compose.yml cd
```open your browser to
you can check the services on
now edit `rest-count/main.py` (for example, you can increase the version to 1.1)
```
docker build -t francescou/rest-count:1.1 rest-count/docker service update --image francescou/rest-count:1.1 cd_restcount
```the updated microservice will be deployed with no downtime.
You can also modify the _rest-ip_ microservice in the same way (see `rest-ip/app.js`).
## Scaling microservices
this section will explain how to can scale up and down the docker services.
open your browser to . There you will find a _rest-count_ service, running on two replicas. Execute
docker service scale cd_restcount=4
check again to ensure that there are now four _rest-count_ instance.
Make a few requests to and then run `docker service logs cd_restcount` to see how requests are processed by different _rest-count_ instances.
You can now scale down the _rest-count_ service without having any down time, e.g.:
docker service scale cd_restcount=2
Again, you can check to see that there are now only two instances.