Giter Site home page Giter Site logo

manos-fr / news_weather_services_python_docker Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 1.77 MB

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.

Dockerfile 5.29% Python 94.71%
docker communication architecture python-service weather

news_weather_services_python_docker's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.