Skip to content

python-microservices/microservices-scaffold

Repository files navigation

microservices-scaffold

Python Microservice Scaffold is an example of how to structure a Flask Microservice Project. This Scaffold is build over PyMS package. PyMS is a Microservice chassis pattern like Spring Boot (Java) or Gizmo (Golang). PyMS is a collection of libraries, best practices and recommended ways to build microservices with Python which handles cross-cutting concerns:

  • Externalized configuration
  • Logging
  • Health checks
  • Metrics (TODO)
  • Distributed tracing

Build Status Coverage Status Requirements Status Updates Python 3

How to run the scaffold

virtualenv --python=python[3.6|3.7|3.8] venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py runserver

Open in your browser http://localhost:5000/template/ui/

Read more info in the documentation page: https://microservices-scaffold.readthedocs.io/en/latest/

Docker

Create and push the image

docker build -t template -f Dockerfile .

Test the image:

docker run -d -p 5000:5000 template

Push to Kubernetes:

kubectl apply -f service.yaml

How to contrib

See https://github.com/python-microservices/pyms/blob/master/CONTRIBUTING.md

Update docs

sphinx-build -b html docs/ _build