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
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/
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
See https://github.com/python-microservices/pyms/blob/master/CONTRIBUTING.md
sphinx-build -b html docs/ _build