This Dockerfile allows you to build a Docker container with a fairly standard and speedy setup for Python web apps with uWSGI.
uWSGI from a number of benchmarks has shown to be the fastest server for python applications and allows lots of flexibility.
Feel free to clone this and modify it to your liking.
-
Add your python app to
/app
directory before build new docker image. -
Check
module
config in uwsgi.ini: If you want to create a Django application container and yourwsgi.py
path is/app/myproject/wsgi.py
, open uwsgi.ini file and changemodule=website.uwsgi:application
asmodule=myproject.uwsgi:application
.
- docker build -t myapp .
- docker run myapp