Skip to content

Project for Master degree. The architecture of python microservices using Docker. Client -> Nginx -> mainApi -> microservices.. The respective service accepts the request, communicates with the database and returns the result to the main api and then to the client.

Notifications You must be signed in to change notification settings

manos-fr/News_Weather_Services_Python_Docker

Repository files navigation

Python Flask - Nginx microservices with Docker

For a detailed step by step guide check my post at Medium

https://medium.com/@manos_fr/python-flask-scalable-microservices-using-docker-compose-and-nginx-load-balancer-e20d421b1ad6

  • Install Docker Engine & Docker Compose
  $ sudo apt-get update
  $ sudo apt-get install docker-ce docker-ce-cli containerd.io

  $ sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  $ sudo chmod +x /usr/local/bin/docker-compose

Docker

- Start the Docker daemon (if needed), or desktop app in Windows
$ sudo systemctl start docker. or sudo service docker start

docker-compose up --build --scale master=2 to create 2 mainApis(servers) and use Nginx's load balancer

docker-compose down (to kill and stop docker images)

  • Sample http requests in terminal
curl -XGET "localhost/weather?city=athens"
curl -XGET "localhost/news?country=gb"
  • Architecture Overview *Update: Added nginx between client and main Api

Arch

About

Project for Master degree. The architecture of python microservices using Docker. Client -> Nginx -> mainApi -> microservices.. The respective service accepts the request, communicates with the database and returns the result to the main api and then to the client.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published