Skip to content

cjsanjay/flask_nginx_docker_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A rest api application build using Flask-restplus with basic auth

  • Python PIL library wrapped inside Flask-restful interface
  • A post call to the rest api with url of the publically accesible image will invoke requested operation on to the image
  • Included operations are: Blur, Greyscale, Flip, Invert, Line, Mask, Mirror, Pixelize, Sepia, SwapChannel, Xor

Pre-requisite: Docker and git installed on the system

Steps to deploy

  • Clone git repository
  • Move to flask_nginx_docker directory
    • cd flask_nginx_docker
  • Run command
    • docker build -t flask_rest_app .
    • docker run -p 80:80 -t flask_rest_app
  • Open browser and navigate to: http://0.0.0.0/api/
  • Use swagger UI to interact with the api
  • Username and password for auth: admin/password
  • API post input request format:
    {
    "id": 0,
    "imageUrl": "string",
    "imageLocalLocation": "string"
    }

Just provide imageUrl value(something that is accessible over internet)

  • Kill the container using(name will be load_app)
    • Docker ps (get the CONTAINER ID)
    • Docker kill CONTAINER ID

About

Sample app rest apis using flask-restplus. Can also serve as boilerplate code for new projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published