From bd8850b6a28fcf00c3e4ed258a8888bc3e523969 Mon Sep 17 00:00:00 2001 From: boyska Date: Mon, 24 Feb 2014 14:54:10 +0100 Subject: [PATCH] deploy contrib/ --- contrib/docker/Dockerfile | 22 ++++++++++++++++++++++ contrib/docker/conf.py | 7 +++++++ contrib/docker/techrec.conf | 13 +++++++++++++ server/default_config.py | 1 - 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 contrib/docker/Dockerfile create mode 100644 contrib/docker/conf.py create mode 100644 contrib/docker/techrec.conf diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile new file mode 100644 index 0000000..8297f66 --- /dev/null +++ b/contrib/docker/Dockerfile @@ -0,0 +1,22 @@ +FROM saucy + +RUN DEBIAN_FRONTEND=noninteractive apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends +python python3 python-virtualenv +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends +python-pip +# e virtualenv3?? a me virtualenvwrapper fa un po' schifo... +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends +virtualenvwrapper + +RUN git clone https://github.com/boyska/techrec.git /opt/techrec +RUN virtualenv --python=python2 /opt/virtualenv +RUN /opt/virtualenv/bin/pip install -r /opt/techrec/server/requirements.txt +RUN mkdir /opt/db +RUN chown nobody /opt/db + +ENV TECHREC_CONFIG /opt/techrec/conf.py +USER nobody +WORKDIR /opt/techrec/server + +ADD conf.py /opt/techrec/ diff --git a/contrib/docker/conf.py b/contrib/docker/conf.py new file mode 100644 index 0000000..dac2c45 --- /dev/null +++ b/contrib/docker/conf.py @@ -0,0 +1,7 @@ +### Your custom configuration + +AUDIO_INPUT='/input' +AUDIO_OUTPUT='/output' +DB_URI='sqlite:////opt/db/techrec.db' +DEBUG = False +HOST='0.0.0.0' diff --git a/contrib/docker/techrec.conf b/contrib/docker/techrec.conf new file mode 100644 index 0000000..1ae1c64 --- /dev/null +++ b/contrib/docker/techrec.conf @@ -0,0 +1,13 @@ +### Supervisor script for techrec + +#however, docker run does not seem to behave well in being supervisorized + +[program:techrec] +autostart=true +command=docker run -a stdout -a stderr -rm -v /data/techrec:/output -v +/rec:/input -expose 8000 -p 9180:8000 --name tr techrec:latest +/opt/virtualenv/bin/python cli.py serve +startsecs=2 +autorestart=false + +# vim: set ft=dosini: diff --git a/server/default_config.py b/server/default_config.py index 6ac7d9b..8a96d51 100644 --- a/server/default_config.py +++ b/server/default_config.py @@ -1,4 +1,3 @@ -OUTPUT_DIR = 'output' HOST = 'localhost' PORT = '8000' DEBUG = True