Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

disqus/docker-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supported tags and respective Dockerfile links

Why not link containers?

In larger deployments, it's harder to tightly couple an application container with it's nginx configs and make sure that they are always 100% paired together. This does not replace a normal upstream proxy, but this is intended to run in front of say, uwsgi or gunicorn.

How to use this image

Create a Dockerfile in your Python app project

FROM disqus/nginx:python2-onbuild

If you need to override your own nginx config files, you can COPY them in

FROM disqus/nginx:python2-onbuild
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/ /etc/nginx/conf.d/
COPY nginx/sites-enabled/ /etc/nginx/sites-enabled/

These images include multiple ONBUILD triggers, which should be all you need to bootstrap most applications. The build will COPY a requirements.txt file, RUN pip install on said file, copy the current directory into /usr/src/app, then run wsgi.py with uwsgi.

You can then build and run the Docker image:

docker build -t my-python-app .
docker run -it --rm --name my-running-app my-python-app

Image Variants

The disqus/nginx images come in many flavors, each designed for a specific use case.

`disqus/nginx:python

This image is a mashup of nginx + python:<version>, meant for running python based applications behind a tightly coupled nginx.

`disqus/nginx:python-onbuild

This image makes deploying a python application behind nginx much easier. It works identically to the python:onbuild images, but also hooks up uwsgi/nginx for you. If your project includes a wsgi.py file in the root, this image will run that with uwsgi and drops an nginx config that will uwsgi_pass to it.