GithubHelp home page GithubHelp logo

robpco / docker-nginx-uwsgi Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 7.0 108 KB

Docker image for deploying Python Web Apps on NGINX. Image includes Nginx, uWSGI and Python.

Home Page: https://hub.docker.com/r/robpco/nginx-uwsgi

License: Apache License 2.0

Shell 32.99% Python 9.16% Dockerfile 57.85%
docker dockerfiles docker-nginx docker-uwsgi docker-alpine docker-python docker-website python-web python-web-development python-webapp

docker-nginx-uwsgi's Introduction

Supported tags and Dockerfile links

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.

NGINX-UWSGI

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/robpco/docker-nginx-uwsgi

Docker Hub Images: https://hub.docker.com/r/robpco/nginx-uwsgi/

Overview

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 variants for each supported Python version (2.7, 3.6).

Usage

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).

Custom Environment Variables

This image supports the following custom environment variables:

  • UWSGI_INI - the path and file of the configuration info
    • default: /app/uwsgi.ini
  • 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

Setting Environment Variables

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.

Setting in a Dockerfile

# ... (snip) ...
ENV LISTEN_PORT 8080
# ... (snip) ...

Setting during docker run with the -e option

docker run -e LISTEN_PORT=8080 -p 8080:8080 myimage

Setting in docker-compose file using the environment: keyword in a docker-compose file

version: '2.2'
services:
  web:
    image: myapp
  environment:
    LISTEN_PORT: 8080

UPDATES

  • 2017-12-11: Added multiple tags per variant: py3.6 is the same as python3.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: Automatic image re-build when Python updates
  • 2017-11-28: Updated Nginx version
  • 2018-05-04: Updated to use pythonx.x-stretch as base & Nginx 1.13.12-1
  • 2018-06-10: Updated to Nginx 1.15.0-1

CHANGELOG

  • 2017-12-15: Fix to avoid duplicate listen entries in nginx.conf
  • 2017-11-30: limit build failures caused by GPG key validation failing
  • 2017-11-28: Fixed console errors from supervisor process:
    • Added explicit path reference to supervisord.conf in Dockerfile CMD statement
    • Added explicitly set username in supervisord.conf

docker-nginx-uwsgi's People

Contributors

robertpeteuil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.