Skip to content

sanogotech/docker-flask-uwsgi-nginx-simple

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Flask app running behind Nginx & uWSGI in a Docker container

Docs: https://pythonise.com/series/learning-flask/python-flask-uwsgi-introduction

https://pythonise.com/series/learning-flask/flask-configuration-files

https://pythonise.com/series/learning-flask/exploring-uwsgi-decorators

https://pythonise.com/series/learning-flask/python-before-after-request

Clone the repo:

git clone https://github.com/sanogotech/docker-flask-uwsgi-nginx-simple

To develop locally, create a new virtual env in the flask directory & run the app:

cd app
python -m venv env
source env/bin/activate
pip install -r requirements.txt
export FLASK_APP=run.py
export FLASK_ENV=development
flask run

Go to - http://127.0.0.1:5000

To run the container locally:

docker-compose up --build

Go to - http://127.0.0.1/

Notes

nginx logs and uwsgi logs will be logged to log/nginx and log/uwsgi respectively. This can be changed by changing the volume mounts in the docker-compose.yml.

Alternatively, delete the volumes to have Docker log to Stdout.

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 60.2%
  • Python 39.8%