Speak Python Boilerplate helps to create a microservice quickly in any environment.
Pre-configured files and templates to create your Flask API endpoint and deploy on Docker quickly.
- Install virtualenv
pip install virtualenv - Create virtualenv
virtualenv venv - Activate virtualenv
venv\Scripts\activate.bat
python install -r requirement.txt
pip freeze > requirements.txt
First go to your venv environment:
python application.py
- application.py
- api
- api_component.py
- utils
- email.py
- Send Error email
- requests.py
- Make a GET OR POST Request
- email.py
- logging.ini
- Logging format file
- application.py
- Main application file
-
Create your first API by adding your
endpointin theapplication.pyfile -
Copy
api_componentfile underapifolder or rename the file name -
Add your logic under the
function -
Start a server and test the endpoint
- docker image build -t repo_name .
- docker tag repo_name organization_name/repo_name
- docker run -p 5000:5000 -d repo_name
docker buildx build -t "________.dkr.ecr.ca-central-1.amazonaws.com/repo_name:latest" . --platform linux/amd64 --push