SteveClement / flask-pipenv-example

Flask application using Pipenv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flask Pipenv Example

Flask application using Pipenv and Docker.

Running locally

Set up Python environment:

$ pipenv install

To create a virtual environment you just execute the $ pipenv shell.

Run a development server:

$ FLASK_APP=helloworld flask run

Docker image

Build the docker image:

$ docker build -t flask-pipenv-helloworld .

Run the Docker Container:

$ docker run -p 8000:8000 flask-pipenv-helloworld

You can find the container runtime details as shown below:

$ docker ps
CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS              PORTS                      NAMES
80af0bce64c7        flask-pipenv-helloworld           "gunicorn -b0.0.0.0:…"   1 second ago        Up Less than a second   0.0.0.0:8000->8000/tcp     silly_goldstine

Running the tests

Install the prerequisites:

$ pipenv install --dev

Runs tests:

$ pipenv run python -m pytest

About

Flask application using Pipenv


Languages

Language:Python 73.9%Language:Dockerfile 26.1%