From: Thomas Fillon Date: Fri, 27 Feb 2015 20:08:04 +0000 (+0100) Subject: Docker-compose: Add draft config files X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3c01a68204ffdaa7642a7fdb9919c7b089f5bd44;p=timeside.git Docker-compose: Add draft config files --- diff --git a/Dockerfile b/Dockerfile index 78f4362..6b87176 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,44 +13,77 @@ # See the License for the specific language governing permissions and # limitations under the License. -from debian:stable +FROM debian:stable -maintainer Guillaume Pellerin +MAINTAINER Guillaume Pellerin , Thomas fillon # install confs, keys and deps -run apt-key adv --keyserver pgp.mit.edu --recv-key E3298399DF14BB7C -run apt-key adv --keyserver pgp.mit.edu --recv-key 07DC563D1F41B907 -run apt-key adv --keyserver pgp.mit.edu --recv-key 5C808C2B65558117 -add ./examples/deploy/apt-app.list /etc/apt/sources.list.d/ -run apt-get update -run apt-get install -y --force-yes apt-utils -run apt-get -y --force-yes -t wheezy-backports dist-upgrade -run apt-get install -y --force-yes -t wheezy-backports build-essential vim python python-dev python-pip nginx postgresql python-psycopg2 supervisor python-timeside git python-tables python-traits python-networkx ipython python-numexpr gstreamer0.10-alsa -run apt-get purge -y --force-yes python-timeside -run apt-get clean +RUN apt-key adv --keyserver pgp.mit.edu --recv-key E3298399DF14BB7C && \ + apt-key adv --keyserver pgp.mit.edu --recv-key 07DC563D1F41B907 + apt-key adv --keyserver pgp.mit.edu --recv-key 5C808C2B65558117 +ADD ./examples/deploy/apt-app.list /etc/apt/sources.list.d/ +RUN apt-get update && \ + apt-get install -y --force-yes python-gst0.10 gstreamer0.10-plugins-good gstreamer0.10-gnonlin gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-alsa vamp-examples +RUN apt-get -y --force-yes -t wheezy-backports dist-upgrade +RUN apt-get install -y --force-yes -t wheezy-backports python-aubio python-yaafe +#RUN apt-get install -y --force-yes -t wheezy-backports build-essential vim python python-dev python-pip nginx postgresql python-psycopg2 supervisor git +RUN apt-get clean +RUN apt-get update && apt-get install -y wget bzip2 + +# Install conda in /opt/miniconda +RUN wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh && \ + bash miniconda.sh -b -p /opt/miniconda && \ + rm miniconda.sh +ENV PATH /opt/miniconda/bin:$PATH +RUN hash -r && \ + conda config --set always_yes yes --set changeps1 yes && \ + conda update -q conda # install tools via pip -run pip install uwsgi ipython +#RUN pip install uwsgi ipython + + +RUN mkdir /opt/TimeSide +WORKDIR /opt/TimeSide + + +# Install binary dependencies with conda +#RUN export deps="setuptools pip coverage matplotlib h5py pytables pandas>=0.15.1 networkx nltk>=3.0 scikit-learn numexpr" +ADD conda-requirements.txt /opt/TimeSide/ +ADD requirements.txt /opt/TimeSide/ +RUN conda install --file conda-requirements.txt && \ + rm /opt/miniconda/lib/libm.so.6 # use the system libm; see github.com/ContinuumIO/anaconda-issues/issues/182 + +# Install Aubio +RUN conda install -c thomasfillon aubio # clone app -add . /opt/TimeSide +ADD . /opt/TimeSide +WORKDIR /opt/TimeSide + + +RUN pip install -r requirements.txt +RUN conda list + +# Link Yaafe in site-packages +RUN ln -s /usr/lib/python2.7/dist-packages/yaafelib /opt/miniconda/lib/python2.7 # setup all the configfiles -run echo "daemon off;" >> /etc/nginx/nginx.conf -run rm /etc/nginx/sites-enabled/default -run ln -s /opt/TimeSide/examples/deploy/nginx-app.conf /etc/nginx/sites-enabled/ -run ln -s /opt/TimeSide/examples/deploy/supervisor-app.conf /etc/supervisor/conf.d/ +#RUN echo "daemon off;" >> /etc/nginx/nginx.conf +#RUN rm /etc/nginx/sites-enabled/default +#RUN ln -s /opt/TimeSide/examples/deploy/nginx-app.conf /etc/nginx/sites-enabled/ +#RUN ln -s /opt/TimeSide/examples/deploy/supervisor-app.conf /etc/supervisor/conf.d/ # install new deps from the local repo -run pip install -e /opt/TimeSide +#RUN pip install -e /opt/TimeSide # add dev repo path -run cd /opt/TimeSide; python setup.py develop +#RUN cd /opt/TimeSide; python setup.py develop # sandbox setup -run /opt/TimeSide/examples/sandbox/manage.py syncdb --noinput -run /opt/TimeSide/examples/sandbox/manage.py migrate --noinput -run /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput +#RUN /opt/TimeSide/examples/sandbox/manage.py syncdb --noinput +#RUN /opt/TimeSide/examples/sandbox/manage.py migrate --noinput +#RUN /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput -expose 80 -cmd ["supervisord", "-n"] +#EXPOSE 80 +#CMD ["supervisord", "-n"] diff --git a/conda-requirements.txt b/conda-requirements.txt new file mode 100644 index 0000000..f31b24d --- /dev/null +++ b/conda-requirements.txt @@ -0,0 +1,15 @@ +coverage=3.7.1=py27_0 +h5py=2.4.0=np19py27_0 +ipython=2.4.1=py27_0 +#ipython-notebook=2.4.1=py27_0 +matplotlib=1.4.3=np19py27_0 +networkx=1.9.1=py27_0 +numpy=1.9.1=py27_0 +pillow=2.7.0=py27_0 +pip=6.0.8=py27_0 +pytables=3.1.1=np19py27_2 +python=2.7.9 +requests=2.5.1=py27_0 +scipy=0.14.0=np19py27_0 +setuptools=12.2=py27_0 +traits=4.4.0=py27_0 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b1da47d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ + +data: + image: tianon/true + volumes: + - /var/lib/postgresql + +db: + image: postgres + volumes_from: + - data + +nginx: + image: nginx + ports: + - "8080:80" + volumes: + - ./examples/deploy/nginx-app.conf:/etc/nginx/sites-enabled/ +# #- ./web/media:/media:ro +# #- ./web//static:/static:ro + links: + - app + +app: + build: . + volumes: + - .:/opt/TimeSide + ports: + - "8000:8000"