You can use this dockerfile to run uwsgi in a docker container, then you can run nginx locally/ in another docker container and route requests trough a docker volume on the socket (e.g. /tmp/socket/uswgi.sock). Just place the dockefile in the same directory as your python uwsgi app. Then build the docker container and run with this command (where uwsgi-python is the name of the image):
docker run -d -e UWSGI_MOUNTPOINT=/ -e UWSGI_APP=app:app -v /tmp/socket:/app/socket uwsgi-python
I use the following nginx configuration with this container:
server {
listen 80;
location / {
uwsgi_pass unix:///tmp/socket/uwsgi.sock;
include uwsgi_params;
}
}