Created
November 5, 2014 13:07
-
-
Save immunda/491280187afc1a4bb031 to your computer and use it in GitHub Desktop.
API Docker config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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