项目作者: amoljagadambe

项目描述 :
Basic flask application Architecture with swagger and docker Integration
高级语言: Python
项目地址: git://github.com/amoljagadambe/flask-application.git
创建时间: 2019-04-15T14:47:37Z
项目社区:https://github.com/amoljagadambe/flask-application

开源协议:Apache License 2.0

下载


flask-application

Basic flask application architecture with swagger and docker integrated.this application has two resource one is file uploader
and second one is recommendation which is content based recommendation.

Install

clone the repository

  1. git clone https://github.com/amoljagadambe/flask-application.git
  2. cd flask-application
  3. # checkout the correct version
  4. git tag # shows the tagged versions
  5. git checkout latest-tag-found-above

Create a virtualenv in the flask-application directory and activate it::

  1. python -m venv venv
  2. venv\Scripts\activate.bat

Install Dependencies in Virtual Environment::

  1. pip install -r requirements.txt

RUN

On Local Virtual Environment::

  1. flask run

On Docker::

  1. $ docker image build -t flask-app .
  2. $ docker run -p 3000:3000 -d --name flask-application flask-app

Save/Load the docker image(optional)

this below queries will save you the hassle of downloading the images from docker hub and increase the speed of
execution, but this is optional you dont need to do this.

  1. $ docker save flask-app > flask-app.tar
  2. $ docker load --input flask-app.tar

Open http://127.0.0.1:3000 in a browser. to access all the api over swagger just add /swagger-ui.html/ at the
end of url.