py2.7,python2.7(python2.7/Dockerfile)py2.7-alpine,python2.7-alpine(python2.7-alpine/Dockerfile)py3.5,python3.5(python3.5/Dockerfile)py3.5-alpine,python3.5-alpine(python3.5-alpine/Dockerfile)py3.6,python3.6(python3.6/Dockerfile)py3.6-alpine,python3.6-alpine(python3.6-alpine/Dockerfile)
You must explicitly use one of the tags above. The latest tag is not assigned since each tag represents a different variant, not an incremental version.
Docker image with Nginx, uWSGI and Python running in a single container to enable running Python Web Apps on NGINX.
GitHub Repo: https://github.com/robertpeteuil/docker-nginx-uwsgi
Docker Hub Images: https://hub.docker.com/r/robpco/nginx-uwsgi/
This Docker image allow the creation/migration of Python Web Apps to run on Nginx and uWSGI in a single container. It's designed for use as base image for:
- Other images - such as a pre-built image for running Flask Apps nginx-uwsgi-flask .
- A development image that can be customized with your unique web-framework, Python libraries and code.
This repo auto-generates images to Docker-Hub. It includes standard and alpine-based variants for each supported Python version (2.7, 3.5, 3.6).
The Docker-Hub repository contains auto-generated images from this repo. They can be referenced (or pulled) by using the image name robpco/nginx-uwsgi, plus a tag for the python version desired (ex: :python3.6), and optionally appending -alpine to the tag (for alpine variants).
This image supports the following custom environment variables:
- UWSGI_INI - the path and file of the configuration info
- default:
/app/uwsgi.ini
- default:
- NGINX_MAX_UPLOAD - the maximum file upload size allowed by Nginx
- 0 = unlimited (image default)
- 1m = normal Nginx default
- LISTEN_PORT - custom port that Nginx should listen on
- 80 = Nginx default
Environment variables can be set in multiple ways. The following examples, demonstrate setting the LISTEN_PORT environment variable via three different methods. These methods apply to the other Environment Variables as well.
# ... (snip) ... ENV LISTEN_PORT 8080 # ... (snip) ...Setting during docker run with the -e option
docker run -e LISTEN_PORT=8080 -p 8080:8080 myimageversion: '2.2' services: web: image: myapp environment: LISTEN_PORT: 8080Inspired by the project at tiangolo/UWSGI-NGINX-DOCKER.
- 2017-12-11: Added multiple tags per variant:
py3.6is the same aspython3.6, and so forth... - 2017-11-29: Added ability to change port Nginx listens on with new environment variable
LISTEN_PORT.- Thanks to github user tmshn
- 2017-11-29: Alpine variants added
- Thanks to github user ProgEsteves
- 2017-11-29: Automatic image re-build when Python updates
- 2017-11-28: Updated Nginx version installed on non-Alpine images
- 2017-12-15: Fix to avoid duplicate listen entries in nginx.conf
- 2017-11-30: Alpine images - eliminated uWSGI random build failures
- 2017-11-30: Non-Alpine images - limit build failures caused by GPG key validation failing
- 2017-11-29: Alpine required additional changes:
- Replace default
/etc/nginx/nginx.confwith an alternate version - Create
/run/nginxdirectory to stop immediate Nginx crash
- Replace default
- 2017-11-28: Fixed console errors from supervisor process:
- Added explicit path reference to
supervisord.confin DockerfileCMDstatement - Added explicitly set username in
supervisord.conf
- Added explicit path reference to