/docker-flask

Dockerized flask with dynamic routes configuration

Primary LanguagePythonApache License 2.0Apache-2.0

Flask dockerized

Introduction

Dockerized Flask with blueprints' dynamic loading to handle routes configured outside the container. Flask run via gunicorn inside the container

Build the image

    ./dk-build.sh

Run the container

    ./dk-run.sh

Run Flask ooutside the container

Intallation

  • Setup a virtualenv and install the dependencies.
  • The script requires python 3.6 or above
    #dowload the script
    $ git clone https://github.com/snafuz/dk-flask.git
    $ cd dk-flask/flask-app
    
    #install virtualenv if you not have it already
    $ pip3 install virtualenv

    # create the virtualenv and activate it
    $ virtualenv flask
    $ . flask/bin/activate

    # install requirements
    (flask) $ pip3 install -r requirements.txt

Usage

Run inside the above virtualenv

./run-flask.sh

Run with auto-reload if blueprints folder changes

./run-with-auto-reload.sh