Skip to content

Instantly share code, notes, and snippets.

@shazow
Created July 3, 2014 20:38
Show Gist options
  • Save shazow/5564f656de1219f72b3f to your computer and use it in GitHub Desktop.
Save shazow/5564f656de1219f72b3f to your computer and use it in GitHub Desktop.
UWSGI Docker
# DOCKER-VERSION 0.6.1
# Borrowed from https://github.com/vvlad/dockerfiles-postgresql-9.3
#
# First run:
# $ docker build -t uwsgi -rm=true .
# $ ID=$(docker run -v "path/to/src:/app/src" -v "path/to/socks:/app/socks" -d uwsgi)
# $ docker wait $ID
# $ docker logs $ID
FROM ubuntu:12.04
MAINTAINER Andrey Petrov "[email protected]"
ENV DEBIAN_FRONTEND noninteractive
RUN locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN echo 'deb http://us.archive.ubuntu.com/ubuntu/ precise universe' >> /etc/apt/sources.list
RUN apt-get -y update
# Install required packages
RUN apt-get -y install wget python-dev python-setuptools python-psycopg2 make libfreetype6-dev libjpeg62-dev libpng12-dev
RUN easy_install pip
RUN pip install virtualenv
ADD init.sh /init.sh
VOLUME ["/app/src", "/app/env", "/app/socks"]
CMD ["/init.sh"]
#!/bin/sh
pip install uwsgi PasteDeploy
virtualenv --system-site-packages /app/env
. /app/env/bin/activate
cd /app/src
python setup.py develop
make -e "INI_FILE=production.ini"
uwsgi --ini-paste production.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment