A simple python stack with gunicorn and supervisor
144
Dockerfile:
FROM python:2.7
MAINTAINER Diego Garcia <[email protected]>
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
Content type
Image
Digest
sha256:66379c6d7…
Size
284.8 MB
Last updated
almost 11 years ago
docker pull drgarcia1986/wsgi:2.7