/flask-sherlock

movie recommendations

Primary LanguagePythonMIT LicenseMIT

Sherlock

Welcome to Sherlock project. Sherlock is a movie recommendation microservice written in Flask.

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

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-sherlock.git
cd flask-sherlock

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

API

curl "http://localhost/api/v1/movies/recommend?title=Kingpin"
curl "http://localhost/api/v1/movies/recommend?title=Lost%20in%20Translation"

Testing

Unit test

docker exec sherlock pytest

Code coverage

docker exec sherlock coverage run -m pytest
docker exec sherlock coverage report

Debug

{
    docker stop sherlock;
    docker build --no-cache --tag flask-sherlock $PWD;
    docker run --rm --detach --name sherlock --publish 80:8080 --volume $PWD/app:/app flask-sherlock;
}