/flask-init-mini

Boilerplate for Flask projects

Primary LanguageDockerfileMIT LicenseMIT

flask-init-mini

This project is a boilerplate for future Flask applications.

Below steps can be executed on any unix like system. I will use ubuntu deployed on O'Reilly's sandbox (alternatively you could use Katacoda's playground). Once the sandbox/playground is ready, execute instructions specified in below sections.

Setup SSH key

This step is option and can be omitted.

Create ssh key and add it to GitHub's SSH keys settings.

ssh-keygen
cat ~/.ssh/id_rsa.pub

Installation

# Cloning the source code
git clone https://github.com/ldynia/flask-init-mini.git
cd flask-init-mini

# Building and running docker container
docker build --tag flask-mini --build-arg FLASK_DEBUG=True .
docker run --detach --name flask-app --publish 80:8080 --rm flask-mini
docker ps

API

curl "http://localhost"

Testing

Unit test

docker exec flask-app pytest

Code coverage

docker exec flask-app coverage run -m pytest
docker exec flask-app coverage report

Stop container

docker stop flask-app