Public Repository

Last pushed: 24 days ago
Short Description
Python image based on debian:wheezy and with usefull scripts.
Full Description

Docker IMAGE for Python 3.4.1


  • Python 3.4.1
  • Virtualenv

Image works with this tree stucture in /srv directory. There should be all of your data.

  • /srv/ - mount your app here
  • /srv/app/ - this is place for your python code
  • /srv/venv/ - python 3.4.1 virtualenv
  • /srv/logs/ - almost all important logs are here

After start the container, start script call:

pip install -r /srv/app/requirements.txt

It installs requirements of your app. After this step, script will call /src/app/ There should be everything what you want to do after container starts. For example:


source ~/venv/bin/activate
cd /srv/app
python migrate
python collectstatic --noinput

At the end, gunicorn is fired:

/srv/venv/bin/gunicorn -u app -g app -b -w $WORKERS --error-logfile /srv/logs/error.log --access-logfile /srv/logs/access.log --reload app

As you can see, gunicorn looks for file in /srv/app. It's standard wsgi application. Here is example for django:

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "triatlon.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

If you are happy with this behaviour, you can run your app:

docker run -d --name=pyapp -p 10001:80 -v /my/site:/srv rosti/python:3.4.1
Docker Pull Command