Skip to content

serinth/python-flask-boilerplate

Repository files navigation

Python + Flask API Boilerplate

Based on Flask API Starter

Requirements

Python 3.8+

pipenv install
pipenv run python src/server.py
curl localhost:8000/metrics/health

Included Helm Chart for CI/CD. Default port is 8000 with hot reloading for DEV environment.

Swagger Documentation

Swagger documentation is generated and provided by flask-restx https://localhost:8000/docs

Environment Variables

Variable Description Default
WORK_ENV DEV, STAGE, TEST, PROD None -> Defaults to DEV

Running Tests

pipenv run nose2

Building the Docker image

  1. Generate a requirements.txt from the lock file:
pipenv lock -r > requirements.txt
  1. Build the docker image
docker build -t mydomain.com/myimage:latest .
  1. Running
docker run \
-e WORK_ENV="PROD" \
-p 8000:8000 \
mydomain.com/myimage:latest

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published