From 10271687216df3623afd7d0fa1a3c80fb0b05b36 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 18 Mar 2015 22:17:42 +0100 Subject: [PATCH] remove django init in Dockerfile, fix mysql start and worker sync --- Dockerfile | 6 +++--- docker-compose-mysql.yml | 5 ++--- examples/deploy/celery_app.sh | 3 +++ examples/sandbox/settings.py | 8 ++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4fd455..9b76fd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,8 +69,8 @@ RUN pip install -r requirements.txt #RUN cd /opt/TimeSide; python setup.py develop # Sandbox setup -RUN /opt/TimeSide/examples/sandbox/manage.py syncdb --noinput && \ - /opt/TimeSide/examples/sandbox/manage.py migrate --noinput && \ - /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput +# RUN /opt/TimeSide/examples/sandbox/manage.py syncdb --noinput && \ +# /opt/TimeSide/examples/sandbox/manage.py migrate --noinput && \ +# /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput EXPOSE 8000 diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml index 816f7e5..4e01fdd 100644 --- a/docker-compose-mysql.yml +++ b/docker-compose-mysql.yml @@ -58,8 +58,8 @@ db: environment: - MYSQL_ROOT_PASSWORD=mysecretpassword - MYSQL_DATABASE=timeside - - MYSQL_USER=timeside - - MYSQL_PASSWORD=changeme + - MYSQL_USER=root + - MYSQL_PASSWORD=mysecretpassword rabbitmq: image: rabbitmq:3-management @@ -92,7 +92,6 @@ worker: command: /bin/sh /opt/TimeSide/examples/deploy/celery_app.sh links: - rabbitmq - - app - db nginx: diff --git a/examples/deploy/celery_app.sh b/examples/deploy/celery_app.sh index 39f1496..c09ad06 100644 --- a/examples/deploy/celery_app.sh +++ b/examples/deploy/celery_app.sh @@ -5,7 +5,10 @@ app_dir='/opt/TimeSide/' sandbox_dir='/home/timeside/' manage=$sandbox_dir'manage.py' +python $manage syncdb --noinput python $manage migrate --noinput +python $manage collectstatic --noinput +python $manage timeside-create-admin-user # Starting celery worker with the --autoreload option will enable the worker to watch for file system changes # This is an experimental feature intended for use in development only diff --git a/examples/sandbox/settings.py b/examples/sandbox/settings.py index 2d96783..f08af19 100644 --- a/examples/sandbox/settings.py +++ b/examples/sandbox/settings.py @@ -19,10 +19,10 @@ DATABASES = { '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. + 'USER': 'root', # Not used with sqlite3. + 'PASSWORD': 'mysecretpassword', # Not used with sqlite3. + 'HOST': 'db', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. # 'OPTIONS': { # 'timeout': 60, # } -- 2.39.5