Skip to content

A Docker image example of Python API server with using Gunicorn and Nginx.

License

Notifications You must be signed in to change notification settings

payt0nc/docker-nginx-gunicorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-nginx-gunicorn

A docker image of python API server with using Gunicorn and Nginx.

Sample Start Script

$> docker run --rm \
    --env GUNICORN_OPTS='--bind=127.0.0.1:5000 --workers=4 --worker-class=gevent --log-level=debug --capture-output' \
    --publish 0.0.0.0:8080:80 \
    nginx-gunicorn-python-api

Gunicorn Config

GUNICORN_OPTS='--bind=127.0.0.1:5000 --workers=4 --worker-class=gevent --log-level=debug --capture-output'

You can extent more Gunicorn varible in this line reference to official document

Nginx Config

The default setting is only provided as reverse proxy to localhost:5000 with 4 worker in using gevent. If you need to custom your configuration, you may use --volume to mount the configuration file into your image or overwrite the configuration while you are building your image.

About

A Docker image example of Python API server with using Gunicorn and Nginx.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages