Based on Flask API Starter
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 is generated and provided by flask-restx https://localhost:8000/docs
Variable | Description | Default |
---|---|---|
WORK_ENV | DEV, STAGE, TEST, PROD | None -> Defaults to DEV |
pipenv run nose2
- Generate a requirements.txt from the lock file:
pipenv lock -r > requirements.txt
- Build the docker image
docker build -t mydomain.com/myimage:latest .
- Running
docker run \
-e WORK_ENV="PROD" \
-p 8000:8000 \
mydomain.com/myimage:latest