Public Repository

Last pushed: 2 years ago
Short Description
A simple python stack with gunicorn and supervisor
Full Description

Dockerfile:

FROM python:2.7

MAINTAINER Diego Garcia <drgarcia1986@gmal.com>

RUN pip install gunicorn supervisor
RUN touch /var/log/supervisor.log

ADD supervisor.conf /etc/supervisord.conf
ADD python_app.conf /etc/supervisor/conf.d/python_app.conf

EXPOSE 8000

CMD ["supervisord"]

supervisord.conf

[include]
files = /etc/supervisor/conf.d/*.conf

python_app.conf

[supervisord]
nodaemon = true

[program:python_app]
command = gunicorn -b 0.0.0.0:8000 -w %(ENV_WORKERS)s run:app
directory = /python_app/
autostart= true
autorestart = true
stdout_logfile = /var/log/supervisor.log
redirect_stderr = true

Copy your app root dir to /python_app/ and don't forget to create a run.py file with the instance of your app (wsgi).
For example:

FROM drgarcia1986/wsgi:2.7

ADD ./myapp /python_app
WORKDIR python_app
RUN pip install -r requirements.txt
ENV WORKERS=6
Docker Pull Command
Owner
drgarcia1986