From: Guillaume Pellerin Date: Tue, 17 Mar 2015 09:22:30 +0000 (+0100) Subject: init first mysql db container X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4e430e935bb90fe576043f3f91edb844fad67016;p=timeside.git init first mysql db container --- diff --git a/Dockerfile b/Dockerfile index bf0bc40..ff9af7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apt-key adv --keyserver pgp.mit.edu --recv-key E3298399DF14BB7C && \ 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 + 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 libmysqlclient-dev 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 diff --git a/conda-requirements.txt b/conda-requirements.txt index f31b24d..b2f33a3 100644 --- a/conda-requirements.txt +++ b/conda-requirements.txt @@ -13,3 +13,4 @@ requests=2.5.1=py27_0 scipy=0.14.0=np19py27_0 setuptools=12.2=py27_0 traits=4.4.0=py27_0 +mysql-python=1.2.5=py27_0 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 3755115..3a18cf2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,11 +27,16 @@ lib: command: /bin/true -# db: -# image: postgres -# volumes_from: -# - datadb - +db: + image: mysql + volumes_from: + - lib + - log + environment: + - MYSQL_ROOT_PASSWORD=mysecretpassword + - MYSQL_DATABASE=timeside + - MYSQL_USER=timeside + - MYSQL_PASSWORD=changeme rabbitmq: image: rabbitmq:3-management ports: @@ -54,6 +59,7 @@ app: - "8000" #default runserver wsgi port links: - rabbitmq + - db worker: build: . diff --git a/examples/deploy/start_app.sh b/examples/deploy/start_app.sh index 0f7fe78..cf84347 100644 --- a/examples/deploy/start_app.sh +++ b/examples/deploy/start_app.sh @@ -9,7 +9,10 @@ app_static_dir=$app_dir'timeside/player/static/' # Copy Sandbox in /home/timeside #  this is not needed for TimeSide but for Timeside-diadems -cp -uR /opt/TimeSide/examples/sandbox/* /home/timeside/ +# cp -uR /opt/TimeSide/examples/sandbox/* /home/timeside/ + +# install staging modules +pip install mysql # django init python $manage syncdb --noinput diff --git a/examples/sandbox/settings.py b/examples/sandbox/settings.py index 56f59ce..2d96783 100644 --- a/examples/sandbox/settings.py +++ b/examples/sandbox/settings.py @@ -16,15 +16,16 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': os.path.join(PROJECT_ROOT, 'timeside.sql'), # Or path to database file if using sqlite3. - 'USER': '', # Not used with sqlite3. - 'PASSWORD': '', # Not used with sqlite3. + 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + # 'NAME': os.path.join(PROJECT_ROOT, 'timeside.sql'), # Or path to database file if using sqlite3. + 'NAME': 'timeside', # Or path to database file if using sqlite3. + 'USER': 'timeside', # Not used with sqlite3. + 'PASSWORD': 'changeme', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. - 'OPTIONS': { - 'timeout': 60, - } + # 'OPTIONS': { + # 'timeout': 60, + # } } } diff --git a/setup.py b/setup.py index 4847c79..3f92f9d 100755 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ setup( 'networkx', 'django-celery', 'watchdog', + 'mysqldb', ], platforms=['OS Independent'], license='Gnu Public License V2',