Skip to content

Instantly share code, notes, and snippets.

@immunda
Created November 5, 2014 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save immunda/491280187afc1a4bb031 to your computer and use it in GitHub Desktop.
Save immunda/491280187afc1a4bb031 to your computer and use it in GitHub Desktop.
API Docker config
FROM debian:wheezy
MAINTAINER Phil Howell
RUN apt-get update && apt-get upgrade -y && apt-get install -y python-pip python-dev build-essential libpq-dev libncurses5-dev
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN mkdir /projects
EXPOSE 9090
CMD ["/usr/local/bin/uwsgi","--http",":9090","--chdir","/projects/api/","--module","uwsgi_handler","--callable","app","--need-app","--py-autoreload","1"]
description "API uwsgi container"
author "Phil Howell"
start on filesystem and started docker and started consul-docker and started registrator-docker
stop on runlevel [!2345]
respawn
# docker start issue workaround, requires inotify-tools
pre-start script
FILE=/var/run/docker.sock
while [ ! -e $FILE ] ; do
inotifywait -t 2 -e create $(dirname $FILE)
done
end script
script
/usr/bin/docker run -a stdout --rm -h api --name api -v /projects/api/:/projects/api/ api-uwsgi:latest
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment