Browse Source

deploy contrib/

boyska 10 years ago
parent
commit
bd8850b6a2
4 changed files with 42 additions and 1 deletions
  1. 22 0
      contrib/docker/Dockerfile
  2. 7 0
      contrib/docker/conf.py
  3. 13 0
      contrib/docker/techrec.conf
  4. 0 1
      server/default_config.py

+ 22 - 0
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/

+ 7 - 0
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'

+ 13 - 0
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:

+ 0 - 1
server/default_config.py

@@ -1,4 +1,3 @@
-OUTPUT_DIR = 'output'
 HOST = 'localhost'
 PORT = '8000'
 DEBUG = True