- /var/log/uwsgi
command: /bin/true
-# datadb:
-# image: debian:wheezy
-# volumes:
-# - /var/lib/postgresql
-# command: /bin/true
+lib:
+ image: debian:wheezy
+ volumes:
+ - /var/lib/rabbitmq
+ - /var/lib/postgres
+ - /var/lib/mysql
+ command: /bin/true
+
# db:
# image: postgres
# volumes_from:
# - datadb
-nginx:
- image: nginx
+rabbitmq:
+ image: rabbitmq:3-management
ports:
- - "8000:80"
- volumes:
- - ./examples/deploy/nginx-app.conf:/etc/nginx/conf.d/default.conf
- volumes_from:
- - static
- - home
- - log
- links:
- - app
+ - "15672:15672"
+ expose:
+ - "5672"
app:
build: .
ports:
- "9000:9000"
expose:
- - "80" #default runserver wsgi port
\ No newline at end of file
+ - "8000" #default runserver wsgi port
+ links:
+ - rabbitmq
+
+worker:
+ image: parisson/timeside
+ volumes:
+ - .:/opt/TimeSide
+ volumes_from:
+ - home
+ command: /bin/sh /opt/TimeSide/examples/deploy/celery_app.sh
+ links:
+ - rabbitmq
+ - app
+
+nginx:
+ image: nginx
+ ports:
+ - "8000:80"
+ volumes:
+ - ./examples/deploy/nginx-app.conf:/etc/nginx/conf.d/default.conf
+ volumes_from:
+ - static
+ - home
+ - log
+ links:
+ - app
+
--- /dev/null
+#!/bin/sh
+
+# paths
+app_dir='/opt/TimeSide/'
+sandbox_dir='/home/timeside/'
+manage=$sandbox_dir'manage.py'
+
+# cp -uR /opt/TimeSide/examples/sandbox/* /home/timeside/
+
+echo "YYYYYYYYYYYYYY"
+
+pip install django-celery
+
+python $manage migrate --noinput
+
+# run Celery worker for our project myproject with Celery configuration stored in Celeryconf
+su -c "$manage celery worker -A celery_app"
# this is not needed for TimeSide but for Timeside-diadems
cp -uR /opt/TimeSide/examples/sandbox/* /home/timeside/
+# add some staging modules
+pip install watchdog django-celery
+
# django init
python $manage syncdb --noinput
python $manage migrate --noinput
python $manage timeside-create-admin-user
# static files auto update
-pip install watchdog
-
watchmedo shell-command --patterns="*.js;*.css" --recursive \
--command='python '$manage' collectstatic --noinput' $app_static_dir &
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
-app.conf.update(
- CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
-)
+# app.conf.update(
+# CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
+# )
@app.task(bind=True)
def debug_task(self):
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
-ALLOWED_HOSTS = []
+ALLOWED_HOSTS = ['*']
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ghv8us2587n97dq&w$c((o5rj_$-9#d-8j#57y_a9og8wux1h7'
# One or more gearman servers
# GEARMAN_SERVERS = ['127.0.0.1']
-BROKER_URL = 'amqp://guest:guest@localhost//'
+BROKER_URL = 'amqp://guest:guest@rabbitmq//'
+CELERY_IMPORTS = ("timeside.server.tasks",)
+CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'
+CELERY_TASK_SERIALIZER = "json"
+CELERY_ACCEPT_CONTENT = ['application/json']
-
-# This will make sure the app is always imported when
-# Django starts so that shared_task will use this app.
-CELERY_IMPORTS = ("timeside.server.tasks", )
-from celery_app import app
+from celery_app import app
\ No newline at end of file